Metadata-Version: 2.3
Name: aioairtable
Version: 0.2.4
Summary: Asynchronous client library for Airtable API
Author: Gleb Chipiga
License: MIT License
         
         Copyright (c) 2021-2025 Gleb Chipiga
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Internet
Classifier: Framework :: AsyncIO
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
Classifier: Topic :: Office/Business :: Groupware
Classifier: Topic :: Office/Business :: Scheduling
Requires-Dist: aiohttp
Requires-Dist: multidict
Requires-Dist: yarl
Requires-Dist: backoff>=2
Requires-Dist: aiofreqlimit>=0.0.7
Requires-Dist: msgspec
Requires-Dist: typing-extensions
Requires-Python: >=3.11, <3.14
Project-URL: Homepage, https://github.com/gleb-chipiga/aioairtable
Description-Content-Type: text/markdown

# Asynchronous client library for Airtable API

[![PyPI version](https://badge.fury.io/py/aioairtable.svg)](https://pypi.org/project/aioairtable)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/gleb-chipiga/aioairtable/blob/master/LICENSE)
[![Downloads](https://img.shields.io/pypi/dm/aioairtable)](https://pypistats.org/packages/aioairtable)

## Key Features

- Asyncio and [aiohttp](https://github.com/aio-libs/aiohttp) based
- All [Airtable REST API](https://airtable.com/api) methods supported
- API rate limit support
- Fully type annotated ([PEP 484](https://www.python.org/dev/peps/pep-0484/))
- Mapping of table fields into variable names

## Installation

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

```bash
pip install aioairtable
```

## Requirements

- Python >= 3.11
- [aiohttp](https://github.com/aio-libs/aiohttp)
- [multidict](https://github.com/aio-libs/multidict)
- [backoff](https://github.com/litl/backoff)
- [aiofreqlimit](https://github.com/gleb-chipiga/aiofreqlimit)
- [yarl](https://github.com/aio-libs/yarl)
- [msgspec](https://github.com/jcrist/msgspec)

## Using aioairtable

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

```python
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())
```
