Skip to main content

README

This tool provides one-way idempotent sync from python dicts. Uses airtable-python-wrapper for access to airtable REST API.

Installing

pip install atsync

Documentation

Just this README so far

Usage example

This library is small and simple and only does one thing: upsert dicts into airtable.

# Define each related table in a list of dicts
related_tables = [
    {
        'table_name': 'Contact Details',
        'primary_key': 'Email Address',  # primary key of this related table
        'related_on': 'Email',  # key in our target table that is related to this table
    },
]

# Define your target table with an atsync Table instance
sync_table = atsync.Table(table_name='User Table',
                          primary_key='User ID',  # primary key as seen in the airtable user interface
                          'base_key': 'appZZZZZZZZZZZZZZ',  # Can be found in the url of your api doco (see below)*
                          'api_key': 'keyABCDEFG',  # Can be found in the api doco (see below)*
                          related_tables=related_tables)

# Assumes all the fields in users.csv are also in airtable
with open('users.csv', 'r') as user_file:
    import csv
    users = csv.DictReader(user_file)
    for user in users:
        sync_table.update_record(user)  # updates existing reocrd with same primary key, otherwise inserts a new record

* To find your base_key and api_key, open Airtable, click the help link on the top right, choose "API Documentation".

  • Your base_key will be the first section of url after the domain: airtable.com/>>this bit<</api/docs#...
  • Your api_key can be found by clicking the "show API key" checkbox at the top right of the page

License

MIT

Metadata

Release files for atsync 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atsync 1.0.1
File Size Uploaded
atsync-1.0.1.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atsync 1.0.1
File Interpreter ABI Platform
atsync-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 6.4 kB

Release files / atsync-1.0.1.tar.gz

Download URL atsync-1.0.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
894ada8b1b4f35c56a48ec23933781664a129e747eea575f4e5731b2c9756229
BLAKE2b-256 checksum
How to use checksums
f7f0616bd57674f1bbb17ea4bae923c0cc8439994cb713f092e0e2e2336294ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / atsync-1.0.1-py2.py3-none-any.whl

Download URL atsync-1.0.1-py2.py3-none-any.whl
Size 3.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
49b031a570bdea07eb187b8d4a5215c1f9cd2866e73c53b18ea62d990b6a5361
BLAKE2b-256 checksum
How to use checksums
5afdcedb77e7826d689031dc8bb13e2bbe99521a9d4410e70121fb2302ca56e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page