# Asynchronous Airtable Python Wrapper
[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370)
[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380)
[![PyPI version](https://badge.fury.io/py/airtable-async.svg)](https://badge.fury.io/py/airtable-async)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/airtable-async.svg?label=pypi%20downloads)](https://pypi.org/project/airtable-async/)
[![Build Status](https://travis-ci.org/lfparis/airbase.svg?branch=master)](https://travis-ci.org/lfparis/airbase)
[![Coverage Status](https://coveralls.io/repos/github/lfparis/airbase/badge.svg?branch=master)](https://coveralls.io/github/lfparis/airbase?branch=master)
## Installing
```bash
pip install airtable-async
```
Requirements: Python 3.7+
## Documentation
*coming soon*
## Example
```python
import asyncio
from airbase import Airtable
api_key = "your Airtable API key found at https://airtable.com/account"
base_key = "name or id of a base"
table_key = "name or id of a table in that base"
async def main() -> None:
async with Airtable(api_key=api_key) as at:
at: Airtable
# Get all bases for a user
await at.get_bases()
# Get one base by name
base = await at.get_base(base_key, key="name")
# Get one base by id
base = await at.get_base(base_key, key="id")
# Get one base by either id or name
base = await at.get_base(base_key)
# Base Attributes
print(base.id)
print(base.name)
print(base.permission_level)
# Set base logging level (debug, info, warning, error, etc)
# Default is "info"
base.log = "debug"
# Get all tables for a base
await base.get_tables()
# Get one table by name
table = await base.get_table(table_key, key="name")
# Get one table by id
table = await base.get_table(table_key, key="id")
# Get one table by either id or name
table = await base.get_table(table_key)
# Base Attributes
print(table.base)
print(table.name)
print(table.id)
print(table.primary_field_id)
print(table.primary_field_name)
print(table.fields)
print(table.views)
# Get a record in that table
table_record = await table.get_record("record_id")
# Get all records in that table
table_records = await table.get_records()
# Get all records in a view in that table
view_records = await table.get_records(view="view id or name")
# Get only certain fields for all records in that table
reduced_fields_records = await table.get_records(
filter_by_fields=["field1, field2"]
)
# Get all records in that table that pass a formula
filtered_records = await table.get_records(
filter_by_formula="Airtable Formula"
)
# Post a record in that table
record = {"fields": {"field1": "value1", "field2": "value2"}}
await table.post_record(record)
# Post several records in that table
records = [
{"fields": {"field1": "value1", "field2": "value2"}},
{"fields": {"field1": "value1", "field2": "value2"}},
{"fields": {"field1": "value1", "field2": "value2"}},
]
await table.post_records(records)
# Update a record in that table
record = {
"id": "record id",
"fields": {"field1": "value1", "field2": "value2"},
}
await table.update_record(record)
# Update several records in that table
records = [
{
"id": "record id",
"fields": {"field1": "value1", "field2": "value2"},
},
{
"id": "record id",
"fields": {"field1": "value1", "field2": "value2"},
},
{
"id": "record id",
"fields": {"field1": "value1", "field2": "value2"},
},
]
await table.update_records(records)
# Delete a record in that table
record = {
"id": "record id",
}
await table.delete_record(record)
# Delete several records in that table
records = [
{"id": "record id"},
{"id": "record id"},
{"id": "record id"},
]
await table.delete_records(records)
if __name__ == "__main__":
asyncio.run(main())
```
## License
[MIT](https://opensource.org/licenses/MIT)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:airtable-async-0.0.1b8.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
airtable-async-0.0.1b8.tar.gz (21个子文件)
airtable-async-0.0.1b8
MANIFEST.in 34B
PKG-INFO 799B
airtable_async.egg-info
PKG-INFO 799B
requires.txt 24B
not-zip-safe 1B
SOURCES.txt 464B
top_level.txt 8B
dependency_links.txt 1B
LICENSE 1KB
setup.cfg 108B
setup.py 1017B
README.md 5KB
airbase
tools.py 13KB
py.typed 0B
validations.py 1KB
__init__.py 84B
airtable.py 20KB
urls.py 79B
utils
semaphore.py 2KB
logger.py 910B
__init__.py 2KB
共 21 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Django和HTML的新疆地区水稻产量影响因素可视化分析系统(含数据集)
- windows conan2应用构建模板
- 3_base.apk.1
- 基于STM32F103C8T6的4g模块(air724ug)
- 基于Java技术的ASC学业支持中心并行项目开发设计源码
- 基于Java和微信支付的wxmall开源卖票商城设计源码
- 基于Java和前端技术的东软环保公众监督系统设计源码
- 基于Python、HTML、CSS的crawlerdemo软件工程实训爬虫设计源码
- 基于多智能体深度强化学习的边缘协同任务卸载方法设计源码
- 基于BS架构的Java、Vue、JavaScript、CSS、HTML整合的毕业设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功