A package used to scrape any public airtable.
Table of Contents
pip install airtable_scraperAfter install, you can use this code for testing (replace url with your own airtable shared view url).
from airtable_scraper import AirtableScraper
url = "https://airtable.com/app7rljHYfQ4tfGrq/shrJ2psoFssctoP5o"
table = AirtableScraper(url=url)
# check status code (ex. 200 = success)
print(table.status)print(table.data)- String: If no filepath is provided, returns a csv formatted string.
csv_str = table.to_csv()- CSV File: If a filepath is provide, save as a csv file. (Change "my_table.csv" to your own filename)
table.to_csv("my_table.csv")- String: If no filepath is provided, returns a json formatted string.
json_str = table.to_json()- JSON File: If a filepath is provide, save as a json file. (Change "my_table.json" to your own filename)
table.to_json("my_table.json")Converts data into python dictionary format.
orient: Useorientparameter to change the type of values of the dictionary.- "records": list like [{column -> value}, … , {column -> value}]
- "index": dict like {index -> {column -> value}}
data_d = table.to_dict()Save data to Pandas DataFrame.
df = table.to_dataframe()You can use these helper methods to checkout additional Airtable metadata or http request parameters.
print a summary of the airtable, including the airtable column type and python datatype.
table.info()Additional Airtable shared view information
print(table.view_id)
print(table.table_id)
print(table.app_id)
print(table.share_id)print(table.headers)
print(table.request_id)
print(table.raw_rows_json)
print(table.raw_columns_json)