单向同步python dicts到airtable。

atsync的Python项目详细描述


自述文件

此工具提供来自python dicts的单向等幂同步。使用airtable python包装器访问airtable rest api。

安装

pip install atsync

文档

目前仅此自述文件

使用示例

这个库小而简单,只做一件事:将dicts插入airtable。

# Define each related table in a list of dictsrelated_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 instancesync_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 airtablewithopen('users.csv','r')asuser_file:importcsvusers=csv.DictReader(user_file)foruserinusers:sync_table.update_record(user)# updates existing reocrd with same primary key, otherwise inserts a new record

*要查找base_keyapi_key,请打开airtable,单击右上角的“帮助”链接,选择“api文档”。

  • 您的base_key将是url的第一个部分,位于域之后:airtable.com/>;这个位<;/api/docs\
  • 您的api_key可以通过单击页面右上角的“show api key”复选框找到

许可证

MIT

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaGCP:一个VM可以位于具有相同地址的不同网络上吗?   java查找安卓中第一个数组的第二个数组中存在的元素的索引   java摄像头活动不工作,设置参数失败   用于python的Base64转换的Java等效代码   为什么JPA/Hibernate在我尝试运行@Query时抛出“java.lang.NegativeArraySizeException:1”?   如何在ubuntu for java的终端上设置路径?   java为什么这两个IP不同?   java JPA:如何将本机查询结果集转换为POJO类集合   java如何在|(12)|(23)中用数字拆分字符串   异常处理如何让程序在达到Java目标后停止运行   java如何不添加以特定字符开头的元素   java如何通过字符串获得swing按钮名称?   java如何在响应不成功时读取改装中的错误体?   java*更新*现在我的程序可以编译但不运行了?