{"id":5562,"library":"airtable","title":"Python Client Library for Airtable","description":"The `airtable` library, maintained by josephbestjames on PyPI (version 0.4.8), is a Python client for interacting with the Airtable REST API. It provides a straightforward interface for performing CRUD (Create, Read, Update, Delete) operations on Airtable bases and tables, abstracting the underlying HTTP requests. This library has a relatively slow release cadence, with its latest update in early 2021. Developers seeking a more actively maintained and feature-rich client should consider `pyairtable`.","status":"maintenance","version":"0.4.8","language":"en","source_language":"en","source_url":"https://github.com/josephbestjames/airtable.py","tags":["Airtable","API","database","wrapper","client","spreadsheet-database"],"install":[{"cmd":"pip install airtable","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Used for making HTTP requests to the Airtable API.","package":"requests","optional":false}],"imports":[{"note":"The class name `Airtable` is capitalized, while the module name is lowercase. Importing `airtable` (lowercase) will not provide the intended class. Some older tutorials or forks might also suggest `from airtablib import Airtable` which is incorrect for this library.","wrong":"from airtable import airtable","symbol":"Airtable","correct":"from airtable import Airtable"}],"quickstart":{"code":"import os\nfrom airtable import Airtable\n\n# It's recommended to use Personal Access Tokens (PATs) and store them as environment variables.\n# Legacy API keys are deprecated by Airtable as of Feb 2024.\nAIRTABLE_BASE_ID = os.environ.get('AIRTABLE_BASE_ID', 'YOUR_BASE_ID')\nAIRTABLE_API_KEY = os.environ.get('AIRTABLE_API_KEY', 'YOUR_PERSONAL_ACCESS_TOKEN') # Or legacy API key if absolutely necessary\nAIRTABLE_TABLE_NAME = 'MyTable'\n\ntry:\n    at = Airtable(AIRTABLE_BASE_ID, AIRTABLE_TABLE_NAME, AIRTABLE_API_KEY)\n    \n    # Fetch all records from the table\n    records = at.get(AIRTABLE_TABLE_NAME)\n    \n    print(f\"Successfully fetched {len(records['records'])} records from '{AIRTABLE_TABLE_NAME}':\")\n    for record in records['records']:\n        print(f\"- ID: {record.get('id')}, Fields: {record.get('fields')}\")\n\n    # Example: Create a new record\n    new_record_data = {'Name': 'New Task', 'Status': 'To Do'}\n    created_record = at.create(AIRTABLE_TABLE_NAME, new_record_data)\n    print(f\"\\nCreated new record: {created_record['id']} with fields {created_record['fields']}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure AIRTABLE_BASE_ID, AIRTABLE_API_KEY, and AIRTABLE_TABLE_NAME are correctly set.\")\n    print(\"Also, verify that the table and fields exist and the token has appropriate permissions.\")","lang":"python","description":"This quickstart demonstrates how to initialize the Airtable client and fetch all records from a specified table. It also includes an example of creating a new record. Authentication should use an Airtable Personal Access Token (PAT) loaded from an environment variable for security, as legacy API keys are deprecated."},"warnings":[{"fix":"Determine which library you intend to use. If you need current features and active development, install `pyairtable` (`pip install pyairtable`). If you specifically need this `airtable` library, ensure your code adheres to its API, which may differ significantly from `pyairtable`.","message":"This `airtable` library (josephbestjames/airtable.py) is distinct from `pyairtable` (gtalarico/pyairtable). The `pyairtable` library is the actively maintained successor, offering more features, better documentation, and more frequent updates. Many online resources and migration guides refer to `pyairtable`. Mixing up these libraries will lead to `ModuleNotFoundError` or unexpected API behavior.","severity":"breaking","affected_versions":"All versions of `airtable` (josephbestjames/airtable.py)"},{"fix":"Generate a Personal Access Token from your Airtable Developer Hub. Configure it with the necessary scopes for your base and tables, and use this token in place of your old API key.","message":"Airtable deprecated legacy API keys on February 1, 2024. While this `airtable` library might still accept API keys, it is strongly recommended to switch to Personal Access Tokens (PATs) for authentication. Using deprecated API keys may lead to authentication failures in the future.","severity":"breaking","affected_versions":"All versions, as this is an Airtable API-level change."},{"fix":"Rename your script to something other than `airtable.py` (e.g., `my_airtable_script.py`).","message":"Naming your Python script `airtable.py` will cause a `ModuleNotFoundError` when you try to import `airtable`. This happens because Python's import system will prioritize your local file over the installed package.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement exponential backoff and retry logic in your application to handle 429 responses gracefully. If using `pyairtable`, it includes built-in retry mechanisms.","message":"Airtable's API enforces a rate limit of 5 requests per second per base. Exceeding this limit will result in 429 'Too Many Requests' errors.","severity":"gotcha","affected_versions":"All versions, as this is an Airtable API-level restriction."},{"fix":"Refer to the method signatures in the `airtable` library's GitHub README or source code. Use `at.get(table_name, record_id=None, ...)` for fetching and `at.create(table_name, fields)` for creating records.","message":"Some older tutorials or documentation for this library (or its predecessors/forks) might refer to methods like `get_all()` or `insert()`. The current version of this `airtable` library (0.4.8) primarily uses `get()` for fetching records (optionally with an ID for a single record) and `create()` for inserting new records.","severity":"deprecated","affected_versions":"Pre-0.4.0, and possibly some forks/wrappers. Be cautious when migrating from older code or other Airtable Python clients."}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}