Skip to main content

Asynchronous client library for Airtable API

Project description

Latest PyPI package version License Downloads count

Key Features

  • Asyncio and aiohttp based

  • All airtable REST API methods supported

  • API rate limit support

  • Fully type annotated (PEP 484)

  • Mapping of table fields into variable names

Installation

aioairtable is available on PyPI. Use pip to install it:

pip install aioairtable

Requirements

Using aioairtable

Pass a value of any hashable type to acquire or do not specify any parameter:

import asyncio

from msgspec import Struct, field

from aioairtable import Airtable, SortDirection


class TableFields(Struct):
    field_1: str | None = field(default=None, name="Field 1")
    field_2: str | None = field(default=None, name="Field 2")
    field_3: str | None = field(default=None, name="Field 3")


async def main() -> None:
    airtable = Airtable(api_key="some_key")
    base = airtable.base("base_id")
    table = base.table("table_name", TableFields)
    records, offset = await table.list_records(
        fields=("field_1", "field_2"),
        filter_by_formula="{field_3}",
        max_records=100500,
        page_size=3,
        sort=(
            ("field_1", SortDirection.ASC),
            ("field_2", SortDirection.DESC),
        ),
        view="table3",
        offset="record033",
    )
    for record in records:
        print(record)

    record = await table.create_record(
        TableFields(
            field_1="value_1_new_001",
            field_2="value_2_new_001",
            field_3="value_3_new_001",
        )
    )
    await record.delete()


asyncio.run(main())

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

aioairtable-0.1.6.tar.gz (14.0 kB view hashes)

Uploaded Source

Built Distribution

aioairtable-0.1.6-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

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