/twitter-python-ads-sdk

A Twitter supported and maintained Ads API SDK for Python.

Primary LanguagePythonMIT LicenseMIT

Getting Started Build Status Code Climate PyPy Version

Installation

Quick Start

Command Line Helper

For more help please see our Examples and Guides or check the online Reference Documentation.

Rate-limit handling and request options '''''''''''''''''''

Parameter Default Description
handle_rate_limit False (boolean) Set True will check rate-limit response header and sleep if the request reached the limit (429).
retry_max 0 (int) The number of times you want to retry when response code is found in retry_on_status.
retry_delay 1500 (int) The number of milliseconds you want to sleep before retry.
retry_on_status [500, 503] (list) The response codes you want to retry on. You can only set >= 400 status codes.
retry_on_timeouts False (boolean) Set True will catch the timeout error and retry the request.
timeout None You can specify either a single value OR a tuple. If a single value is specified, the timeout value will be applied to both the connect and the read timeouts. See https://2.python-requests.org/en/master/user/advanced/#timeouts for more details of the usage.

Compatibility & Versioning

This project is designed to work with Python 3.5 or greater. While it may work on other version of Python, below are the platform and runtime versions we officially support and regularly test against.

Platform Versions
CPython 3.5, 3.6, 3.7
PyPy 7.x

All releases adhere to strict semantic versioning. For Example, major.minor.patch-pre (aka. stick.carrot.oops-peek).

Development

If you’d like to contribute to the project or try an unreleased development version of this project locally, you can do so quite easily by following the examples below.

We love community contributions! If you’re planning to send us a pull request, please make sure read our Contributing Guidelines first.

Feedback and Bug Reports

Found an issue? Please open up a GitHub issue or even better yet send us a pull request. Have a question? Want to discuss a new feature? Come chat with us in the Twitter Community Forums.

Error Handling

Like the Response and Request classes, the Ads API SDK fully models all error objects for easy error handling.

error-hierarchy

License

The MIT License (MIT)

Copyright (C) 2015 Twitter, Inc.

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.