Utility for caching api responses from the airtable-python-wrapper based on airtable-caching by rmountjoy
Project description
Airtable Cacher
This plugin is fork of the work done by Ron Mountjoy on Airtable Caching
https://github.com/rmountjoy92/AirtableCaching
Caching
First you must setup a recurring script that will cache the table.
from airtable_cacher import Base
airtable = Base(<AIRTABLE_BASE_ID>, <AIRTABLE_API_KEY>)
"""
Main Function
"""
airtable.cache_table(<AIRTABLE_PRODUCTS_TABLE>)
You can optionally supply a third argument to Base()
for setting the json folder like so:
from airtable_cacher import Base
airtable = Base(<AIRTABLE_BASE_ID>, <AIRTABLE_API_KEY>, "my_json_folder")
Caching images
If you'd like to cache images, you can do so by supplying an optional fourth argument
Accessing cached data
from airtable_cacher import Table
products_table = Table(<AIRTABLE_BASE_ID>,<AIRTABLE_PRODUCTS_TABLE>)
If you have supplied a custom JSON folder path in the caching, you supply that as an optional third argument in
Table()
from airtable_cacher import Table
products_table = Table(<AIRTABLE_BASE_ID>,<AIRTABLE_PRODUCTS_TABLE>, "my_json_folder")
To get all records then use
records = products_table.all()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
airtable-cacher-1.1.1.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for airtable_cacher-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 744cd409ad98eb0238b0d1a540df35328ab6aef8a148f5ce4124e4b0600dc235 |
|
MD5 | 3eaa71e4294e6e907017f0ac02977f0e |
|
BLAKE2b-256 | 0689a1b1e007a5a20ed71e3ae01c78067ede0a7f240ca8743c681b1d5f9878dd |