Skip to main content

Python DB-API and SQLAlchemy interface for Airtable.

Project description

airtable-db-api PyPI version main workflow codecov

A Python DB API 2.0 for Airtable

This module allows you to query Airtable using SQL. It exposes:

SQLAlchemy support

This module provides a SQLAlchemy dialect.

from sqlalchemy.engine import create_engine

engine = create_engine(
    'airtable://:keyXXXX@appYYY?peek_rows=10&tables=tableA&tables=tableB',
    date_columns={"tableA": ["My Date Field"]},
)

Metadata

At various points we need to know:

  1. The list of Tables supported in the Base
  2. The list of columns (Fields) supported on a given Table
  3. The type information for each Field

As of now we solve 1) by passing in a list of Tables using the tables query parameter on the URL. We solve 2) and 3) using some combination of the peek_rows query parameter specifying the number of rows to fetch from Airtable to guess Field types and a date_columns engine parameter to specify which columns should be parsed as Dates.

Alternatively, 1-3 could all be solved with a comprehensive base_metadata engine parameter that specifies the Tables and Fields. There are a number of ways to generate this, but one approach is scraping the Base's API docs page using a technique like this.

Further options are documented here

Development

Python

$ pip install -r requirements-dev.txt

pre-commit

$ pre-commit install

black

Can be run manually as:

black --target-version py37

Roadmap

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

sqlalchemy-airtable-0.0.1.dev3.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

sqlalchemy_airtable-0.0.1.dev3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy-airtable-0.0.1.dev3.tar.gz.

File metadata

File hashes

Hashes for sqlalchemy-airtable-0.0.1.dev3.tar.gz
Algorithm Hash digest
SHA256 99fc5f58995a3ea5e5e460a4269f99f091e3726ea455ae11b2aa3a4efcccc06d
MD5 39e96b0ef1ae85422340f94c7decbee5
BLAKE2b-256 5380146eb5f33dee69f4f2b02468336d5eee6ea4eafa4e73efd961597aef622e

See more details on using hashes here.

File details

Details for the file sqlalchemy_airtable-0.0.1.dev3-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_airtable-0.0.1.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 d532238c529398ec922d275baa70f36007a2af8e40997a9467b984a7c29a56b9
MD5 5744336e8d7136f7e4ae734ba3a54099
BLAKE2b-256 01714a62080a8ef119335d6401b0ae10ff78404262ba98531baf4cb8684d4e85

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page