Skip to content

Airtable

Rachel Xie edited this page Apr 28, 2023 · 3 revisions

Resources, Links

Basics

  • An Airtable environment has six main components:
    • Workspace: a collection of bases
    • Base: a collection of tables, looks like database, has all unique project information
    • Table: like a spreadsheet, stores data in rows and columns
    • View: different ways of looking at the data (grid view, gantt table view, gallery view, etc)
    • Field: information; different field types include long data, image, date, audio
    • Record: one row of the table
  • Uses REST api
    • Means Representational state transfer: “a software architectural style that describes a uniform interface between physically separate components, often across the Internet in a Client-Server architecture” (Wikipedia)

Accessing Airtable

To find base ID:

  • Log into Airtable account
  • Go to developer hub by clicking on account icon in the upper right corner and choosing from the dropdown menu
  • Click web developer api in the sidebar
  • Scroll to the bottom of the introduction page
  • Click on the base you want the base id for
  • On this new page, should be a line that says “The ID for this base is [BASE ID HERE]”.

To generate a personal access token:

  • Log into Airtable account
  • Click on the account icon in the upper right
  • Click on “Developer Hub”
  • Personal Access Tokens should be an option in the sidebar, create from there
    • Make sure your scope is set to read, and that the environment variable on both your computer and in your IDE is set so that it’s TEMP_KEY=[YOUR ACCESS TOKEN] (without the square brackets)
  • for more help with this: https://airtable.com/developers/web/guides/personal-access-tokens

PyAirtable:

  • When you do a search with it using table.all(), you will get back results from that table in the form of a list containing a dict containing another dict that has all the data for one row of the table
    • outer list is list of search results
    • outer dict contains ‘id’, ‘createdTime’, and ‘fields’ of a record (one row of the table)
    • inner dict associated with the key ‘fields’ is going to have key that is column header, and value that is the value for that particular row

Clone this wiki locally