A Python ORM for Airtable.
Project description
airstorm
Airstorm is a dynamic Python ORM for Airtable. It allows you to easily interact with any base using Python with minimal setup.
Main Features
- Object-oriented interface.
- Dynamic generation of data models from schema.
- Automatic foreign-key resolution.
- Caching layer to avoid abusing the Airtable API.
Installation
pip install airstorm
Usage
from airstorm.base import Base
base = Base('your_base_id', 'your_api_key', {'your': 'schema'})
fruit_juice = base.FruitJuice('some_fruit_juice_id') # Accessing the model for the "Fruit Juices" table.
price_tag = fruit_juice.price_tag # Accessing the "Price Tag" field value.
for fruit in fruit_juice.fruits: # Accessing a linked record in a breeze.
print(fruit.name)
Getting the Schema
Unfortunatly currently this part of the process is not ideal. Because Airtable does not provide access to the schema via their API, you'll have to "download" the schema manually via a web browser of choice.
The following gist is a script that you can run on a Chrome console from the Airtable base API page to get back the JSON schema that airtstorm is expecting to be fed with.
Roadmap
- Downlading schema automatically using pyppeteer.
- Field validation where possible.
- Auto-generated model lists.
- Push changes. Currently we are read-only.
- Advance queries. Lot to think about here.
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
airstorm-0.1.0.dev1.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for airstorm-0.1.0.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f66c13e442d99a20a24d0b7adc666a2d536bbcb4f9d2f7031dd8f2254f4de76b |
|
MD5 | 2ee2e95f5a491b28774786c785523439 |
|
BLAKE2b-256 | 4134aa574dbde754c1038ee801034177abc763f1df9912384a352f54e4a2ba65 |