Getting started
Working with files
Coding and analysis tools
Collaboration
Security and privacy
Deepnote for education
Additional resources
Airtable
Deepnote can query data from Airtable bases. Follow these docs to create your own notebook to connect to Airtable, query data, and visualize it.
1. Duplicate the Airtable template
Open the template by following this link ->
Click the "duplicate" button on the top right corner to do this. Once you've got the template in your Deepnote workspace, you can connect it to your Airtable base.
2. Connect to Airtable from Deepnote
Find your Airtable API key
Follow these instructions to find your API key.
Update the API key in your notebook
Change the variable AIRTABLE_API_KEY
to match your API key. If you'd like to keep your data secure, consider storing the token as an environment variable. Environment variables in Deepnote are encrypted and provide a secure way of storing sensitive data.
Find your Airtable base ID
Find the ID of the Airtable base you want to fetch data from by following these instructions.
Update the base ID in your notebook
Change the variable AIRTABLE_BASE_ID
to match the base ID you just found.
Update the table name in your notebook
Change the variable AIRTABLE_TABLE_NAME
to match the name of the table you want to fetch data from. This is the title of the tab in the Airtable UI.
3. Query Airtable data from Deepnote
The notebook will set up a table
object that you can use to fetch any data from your table. For example, the code below fetches the data and converts it to a Pandas dataframe.
from pyairtable import Table
import pandas as pd
AIRTABLE_TABLE_NAME = 'Sales' # change this to the name of your table
table = Table(AIRTABLE_API_KEY, AIRTABLE_BASE_ID, AIRTABLE_TABLE_NAME)
# table.all() is a method in pyAirtable to get all rows from a table
# docs: https://pyairtable.readthedocs.io/en/latest/api.html
rows = table.all()
df = pd.DataFrame([row["fields"] for row in rows])
df
When executing the code above, Deepnote will visualize the output dataframe, like we see in the example below.
What's next?
Now that you're querying data, you can share it with your team. You can even turn your charts into a shareable dashboard.
Check out the docs for pyairtable for more information on how to fetch data from Airtable.
Still need help? Deepnote's community of over 5,000 data enthusiasts and professionals is always there for you. Post any questions into the Q&A channel here.