{"id":6976,"library":"airtable-python-wrapper","title":"Airtable Python Wrapper","description":"airtable-python-wrapper is a Python API client wrapper for the Airtable API, enabling programmatic interaction with Airtable bases and tables. The latest version is 0.15.3, released in July 2021. While functional, this library has effectively been superseded by 'pyairtable' for its 1.x+ releases, and no new releases are expected under the `airtable-python-wrapper` name.","status":"active","version":"0.15.3","language":"en","source_language":"en","source_url":"https://github.com/gtalarico/airtable-python-wrapper","tags":["airtable","api","wrapper","database","no-longer-maintained","pyairtable-predecessor"],"install":[{"cmd":"pip install airtable-python-wrapper","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used for making HTTP requests to the Airtable API.","package":"requests","optional":false}],"imports":[{"note":"The primary class is 'Airtable', not 'Api' or 'AirtableAPI', especially in recent versions.","wrong":"from airtable import Api","symbol":"Airtable","correct":"from airtable import Airtable"},{"note":"Common mistake with incorrect module name. The package name is 'airtable-python-wrapper', but the module to import is 'airtable'.","wrong":"from airtablib import Airtable","symbol":"Airtable","correct":"from airtable import Airtable"},{"note":"Another common mistake with outdated import paths and class names.","wrong":"from airtable_wrapper import AirtableAPI","symbol":"Airtable","correct":"from airtable import Airtable"}],"quickstart":{"code":"import os\nfrom airtable import Airtable\n\n# It's recommended to store sensitive information like API keys in environment variables\nAIRTABLE_API_KEY = os.environ.get('AIRTABLE_API_KEY', 'YOUR_API_KEY')\nAIRTABLE_BASE_ID = os.environ.get('AIRTABLE_BASE_ID', 'YOUR_BASE_ID')\nAIRTABLE_TABLE_NAME = os.environ.get('AIRTABLE_TABLE_NAME', 'YOUR_TABLE_NAME')\n\n# Initialize Airtable client\nairtable = Airtable(AIRTABLE_BASE_ID, AIRTABLE_TABLE_NAME, api_key=AIRTABLE_API_KEY)\n\n# Fetch all records from the table\nrecords = airtable.get_all()\nprint(f\"Fetched {len(records)} records.\")\n# print(records[0]) # Uncomment to see an example record\n\n# Insert a new record\nnew_record_data = {'Name': 'New Task', 'Status': 'To Do'}\ninserted_record = airtable.insert(new_record_data)\nprint(f\"Inserted new record with ID: {inserted_record['id']}\")\n\n# Update a record (using its ID)\n# Note: You'll need a valid record ID for this to work.\n# Example: record_to_update_id = inserted_record['id']\n# updated_data = {'Status': 'Done'}\n# updated_record = airtable.update(record_to_update_id, updated_data)\n# print(f\"Updated record with ID: {updated_record['id']}\")\n\n# Search for records by field value\nfound_records = airtable.search('Name', 'New Task')\nprint(f\"Found {len(found_records)} records matching 'New Task'.\")","lang":"python","description":"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."},"warnings":[{"fix":"For 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+.","message":"The `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.","severity":"breaking","affected_versions":"0.15.x and earlier"},{"fix":"Update your code to pass `api_key` directly: `airtable = Airtable('base_id', 'table_name', api_key='YOUR_API_KEY')`.","message":"As 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.","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"Ensure 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`.","message":"Python 2 and IronPython support were dropped starting from version 0.15.0.","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"Locate 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', ...)`.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Change your import statement to `from airtable import Airtable`.","cause":"Incorrect module name in the import statement. The package `airtable-python-wrapper` installs the module `airtable`.","error":"ModuleNotFoundError: No module named 'airtablib' (or 'airtable_wrapper')"},{"fix":"Change your import statement to `from airtable import Airtable` and use `Airtable(...)` to instantiate.","cause":"Attempting to import a class named `Api` which does not exist in the `airtable-python-wrapper` library. The main class is `Airtable`.","error":"ImportError: cannot import name 'Api' from 'airtable'"},{"fix":"Rename your script or any conflicting file named `airtable.py` to something else (e.g., `my_airtable_script.py`) to avoid module name collisions.","cause":"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.","error":"ImportError: cannot import name 'Airtable' from 'airtable' (path/to/your/project/airtable.py)"},{"fix":"If 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\"')`.","cause":"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()`.","error":"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'}]"}]}