ORM for Airtable tables
Project description
Python ORM for Airtable tables
Installation
pip install airtable-orm
Usage
from dataclasses import dataclass
# Importing library
from airtable_orm import AirtableORM
# Initialize the object and get the session
orm = AirtableORM("airtable://:<YOUR API KEY>@<YOUR APP KEY>")
session = orm.get_session()
# Create your data class with properties same as your Airtable tables
# The name of the class muse be matched to the Airtable table name
@dataclass
class MyEntity:
id: str
name: str
# Create new object for the dataclass
new_entity = MyEntity("id#1", "My name")
# Run add() to create new entry
session.add(new_entity)
# Run commit() to save the data to Airtable
session.commit()
To list all the data as object
data = session.query(MyEntity).all()
for _ in data:
print(_.name)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
airtable_orm-1.0.4.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for airtable_orm-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c628a396e463bc4e46025dad7599972b611a3375bbb7a7df88969f597ef440d |
|
MD5 | 4775f143fd9447f71e3338510dc9a948 |
|
BLAKE2b-256 | 77d99df208cf96397081caab1674f4e5672619ad00d05f1361e67ceec5fe7111 |