Getting Started

Installation

$ pip install pyairtable

Warning

Looking for airtable-python-wrapper? Check out 0.x Migration.


Authorization Token

Airtable accepts two types of authentication tokens: Api Keys, and Personal Access tokens. Your auth token should be securely stored. A common way to do this, is to store it as an environment variable, and load it using os.environ:

import os
api_key = os.environ["AIRTABLE_API_KEY"]

Quickstart

The easiest way to use this client is to use the Table class to fetch or update your records:

>>> import os
>>> from pyairtable import Table
>>> api_key = os.environ['AIRTABLE_API_KEY']
>>> table = Table(api_key, 'base_id', 'table_name')
>>> table.all()
[ {"id": "rec5eR7IzKSAOBHCz", "fields": { ... }}]
>>> table.create({"Foo": "Bar"})
{"id": "recwAcQdqwe21as", "fields": { "Foo": "Bar" }}]
>>> table.update("recwAcQdqwe21as", {"Foo": "Foo"})
{"id": "recwAcQdqwe21as", "fields": { "Foo": "Foo" }}]
>>> table.delete("recwAcQdqwe21as")
True

For more details on the available classes and methods check out the Airtable Api section.