Skip to main content

Airtable

pip install pyairtable
from langchain.document_loaders import AirtableLoader
  • 在此处获取您的API密钥here
  • 在此处获取您的基地IDhere
  • 从表格URL中获取您的表格ID,如here所示。
api_key = "xxx"
base_id = "xxx"
table_id = "xxx"
loader = AirtableLoader(api_key, table_id, base_id)
docs = loader.load()

将每个表行返回为dict

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