用于Python的Twitter Ads SDK API。

twitter-ads-v2的Python项目详细描述


Build StatusPyPIPyPI version

入门

安装

# install the latest release
pip install twitter-ads-v2

快速入门

^{pr2}$

endpoint_type

为了提供一致的接口,每个API方法的第一个参数总是endpoint_type

data=client.campaigns('load',id='campaign_id')

在上面的例子中,load是这个调用的endpoint_type。每个endpoint_type的术语如下所述。在

^{}descriptionHTTP method
^{}Retrieve all or some of the entities’ details depends on the request parameters from an index endpoint (i.e., most index endpoints have a parameter that can scope the results).GET
^{}Retrieve a specific entity details from a show endpoint (i.e., most show endpoints require an entity id to retrieve as part of resource URI).GET
^{}Create a new entity.POST
^{}Update a specific entity.PUT
^{}Delete a specific entity.DELETE
^{}Create/Update/Delete entities depends on the POST body data (normally a JSON object).POST

请求参数

除上面提到的endpoint_type之外的所有请求参数都应作为关键字参数传递。在

速率限制处理和请求重试

client=twitter_ads_v2.Client(ACCOUNT_ID,CONSUMER_KEY,CONSUMER_SECRET,ACCESS_TOKEN,ACCESS_TOKEN_SECRET,options={'handle_rate_limit':True,'retry_max':3,'retry_delay':5000,'retry_on_status':[404,500,503]})
^{tb2}$

兼容性和版本控制

这个项目是为使用python3.5或更高版本而设计的。虽然它可以在其他版本的Python上运行,但下面是我们正式支持并定期测试的平台和运行时版本。在

^{3}$

所有版本都遵循严格的语义版本控制。例如,主要.次要.修补-前(又名。大棒。胡萝卜。哦-窥视)。在

发展

如果你想为这个项目做贡献或者在本地尝试这个项目的一个未发布的开发版本,你可以很容易地按照下面的例子来做。在

# clone the repository
git clone git@github.com:smaeda-ks/twitter-python-ads-sdk-v2.git
cd twitter-python-ads-sdk-v2

# installing a local unsigned release
pip install -e .

测试

$ python setup.py flake8 && python setup.py test

文档

如果您想对项目文档做出贡献,您需要按照以下步骤设置Sphinx并构建页面。在

# install dependencies
$ pip install -e .[doc]# build pages
$ cd sphinx/
$ make clean && make html

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

推荐PyPI第三方库


热门话题
java TestNG跨浏览器测试在启动第一个浏览器后失败   java如何根据本地存储数据设置默认下拉值和选择   数组Java程序以打印字符串中只有一次可用的字符   java A4j:commndButton和A4j:commandLink未显示在输出中   javajavax。servlet。Apache Karaf 2.3.0中的http包   如果对象是可序列化/可打包的,则java是可序列化/可打包的数组   如果实现了自动关闭,java Helper将调用close()?   java不能转换为org。springframework。奥姆。冬眠4。LocalSessionFactoryBean   java Eclipse不会启动JVM不兼容   java Hibernate关系错误   java我应该设置“从池中获取连接”的超时吗?   java Spring引导连接到docker服务mongodb   java NullPointerException从何而来?   java JSP使src url的结尾成为javascript变量   java spring父上下文和子上下文之间有什么区别?