Registry /
crm-productivity / airtable-python-wrapper
Install & Compatibility
Where this runs
tested against v0.15.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.623s · 21.3MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.1s · import 0.547s · 22MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Airtable
✓ from airtable import Airtable
✗ from airtable import Api
The primary class is 'Airtable', not 'Api' or 'AirtableAPI', especially in recent versions.
Airtable
✓ from airtable import Airtable
✗ from airtablib import Airtable
Common mistake with incorrect module name. The package name is 'airtable-python-wrapper', but the module to import is 'airtable'.
Airtable
✓ from airtable import Airtable
✗ from airtable_wrapper import AirtableAPI
Another common mistake with outdated import paths and class names.
Initialize the Airtable client with your Base ID, Table Name, and API Key, then perform basic CRUD (Create, Read, Update, Delete) operations. Ensure API key is stored securely.
import os
from airtable import Airtable
# It's recommended to store sensitive information like API keys in environment variables
AIRTABLE_API_KEY = os.environ.get('AIRTABLE_API_KEY', 'YOUR_API_KEY')
AIRTABLE_BASE_ID = os.environ.get('AIRTABLE_BASE_ID', 'YOUR_BASE_ID')
AIRTABLE_TABLE_NAME = os.environ.get('AIRTABLE_TABLE_NAME', 'YOUR_TABLE_NAME')
# Initialize Airtable client
airtable = Airtable(AIRTABLE_BASE_ID, AIRTABLE_TABLE_NAME, api_key=AIRTABLE_API_KEY)
# Fetch all records from the table
records = airtable.get_all()
print(f"Fetched {len(records)} records.")
# print(records[0]) # Uncomment to see an example record
# Insert a new record
new_record_data = {'Name': 'New Task', 'Status': 'To Do'}
inserted_record = airtable.insert(new_record_data)
print(f"Inserted new record with ID: {inserted_record['id']}")
# Update a record (using its ID)
# Note: You'll need a valid record ID for this to work.
# Example: record_to_update_id = inserted_record['id']
# updated_data = {'Status': 'Done'}
# updated_record = airtable.update(record_to_update_id, updated_data)
# print(f"Updated record with ID: {updated_record['id']}")
# Search for records by field value
found_records = airtable.search('Name', 'New Task')
print(f"Found {len(found_records)} records matching 'New Task'.")
Debug
Known issues
breakingThe `airtable-python-wrapper` library has been renamed to `pyairtable` for its 1.x+ releases. New features and ongoing development are in `pyairtable`, and `airtable-python-wrapper` will not receive further updates beyond 0.15.3. Migration to `pyairtable` is recommended for active projects.fixFor new projects or upgrades, install `pyairtable` (`pip install pyairtable`) and consult its migration guide for breaking changes between `airtable-python-wrapper` and `pyairtable` 1.x+.
affects: 0.15.x and earlier
breakingAs of version 0.15.0, API key configuration via environment variables was dropped. The `api_key` must now be passed directly as an argument to the `Airtable` constructor.fixUpdate your code to pass `api_key` directly: `airtable = Airtable('base_id', 'table_name', api_key='YOUR_API_KEY')`. affects: >=0.15.0
breakingPython 2 and IronPython support were dropped starting from version 0.15.0.fixEnsure your project runs on Python 3.5 or newer. The library officially supported 3.7 and 3.8 as of 0.13.0, and newer Python versions are supported by its successor, `pyairtable`.
affects: >=0.15.0
gotchaThe `Airtable` constructor expects the `base_id` (a string like 'appXXXXXXX') not the human-readable 'base name'. Using the base name will lead to connection errors.fixLocate your Airtable base ID from the Airtable API documentation for your base and use it in the constructor: `Airtable('YOUR_BASE_ID', 'Your Table Name', ...)`. affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'airtablib' (or 'airtable_wrapper')
Incorrect module name in the import statement. The package `airtable-python-wrapper` installs the module `airtable`.
fixChange your import statement to `from airtable import Airtable`.
ImportError: cannot import name 'Api' from 'airtable'
Attempting to import a class named `Api` which does not exist in the `airtable-python-wrapper` library. The main class is `Airtable`.
fixChange your import statement to `from airtable import Airtable` and use `Airtable(...)` to instantiate.
ImportError: cannot import name 'Airtable' from 'airtable' (path/to/your/project/airtable.py)
This usually happens when your own Python script or a file in your project directory is named `airtable.py`, causing Python to import your local file instead of the installed library.
fixRename your script or any conflicting file named `airtable.py` to something else (e.g., `my_airtable_script.py`) to avoid module name collisions.
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: ... [Error: {'type': 'INVALID_FILTER_BY_FORMULA', 'message': 'The formula for filtering records is invalid: unknown field names: id'}]
Attempting to use `id` (Airtable's internal record ID) directly in a formula without explicitly creating a formula field in Airtable named 'id' with the formula `RECORD_ID()`.
fixIf you need to filter or search by record ID using formulas, create a new field in your Airtable base, name it 'Record ID' (or similar), set its type to 'Formula', and use the formula `RECORD_ID()`. Then refer to this new field name in your Python formula, e.g., `airtable.get_all(formula='{Record ID} = "recXXXXXXX"')`. Upgrade
Version history
0.15.3latest on PyPI · released Jul 27, 2021
Audit
Dependencies
requestsrequiredUsed for making HTTP requests to the Airtable API.