Files
langchain/docs/extras/integrations/document_loaders/airtable.ipynb
T

2.9 KiB

Airtable

In [ ]:
! pip install pyairtable
In [7]:
from langchain.document_loaders import AirtableLoader
  • Get your API key here.
  • Get ID of your base here.
  • Get your table ID from the table url as shown here.
In [ ]:
api_key = "xxx"
base_id = "xxx"
table_id = "xxx"
In [9]:
loader = AirtableLoader(api_key, table_id, base_id)
docs = loader.load()

Returns each table row as dict.

In [10]:
len(docs)
Out [10]:
3
In [11]:
eval(docs[0].page_content)
Out [11]:
{'id': 'recF3GbGZCuh9sXIQ',
 'createdTime': '2023-06-09T04:47:21.000Z',
 'fields': {'Priority': 'High',
  'Status': 'In progress',
  'Name': 'Document Splitters'}}