All Projects → twitterdev → Twitter Python Ads Sdk

twitterdev / Twitter Python Ads Sdk

Licence: mit
A Twitter supported and maintained Ads API SDK for Python.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Twitter Python Ads Sdk

Searchtwitter
Android app, which allows to search tweets as user types and scroll them infinitely
Stars: ✭ 14 (-87.72%)
Mutual labels:  twitter-api, twitter
Talon For Twitter Android
The most powerful and beautiful Twitter client available.
Stars: ✭ 1,022 (+796.49%)
Mutual labels:  twitter-api, twitter
Node Twitter Api
Twitter API 1.1 client for NodeJS
Stars: ✭ 29 (-74.56%)
Mutual labels:  twitter-api, twitter
Awesome Twitter Tools
A curated list of awesome twitter tools
Stars: ✭ 113 (-0.88%)
Mutual labels:  twitter-api, twitter
21 Recipes
📕 An R/rtweet edition of Matthew A. Russell's Python Twitter Recipes Book
Stars: ✭ 69 (-39.47%)
Mutual labels:  twitter-api, twitter
Twitter Post Fetcher
Fetch your twitter posts without using the new Twitter 1.1 API. Pure JavaScript! By Jason Mayes
Stars: ✭ 886 (+677.19%)
Mutual labels:  twitter-api, twitter
Tweepy
Twitter for Python!
Stars: ✭ 8,293 (+7174.56%)
Mutual labels:  twitter-api, twitter
Twitterapi
Minimal python wrapper for Twitter's REST and Streaming APIs
Stars: ✭ 724 (+535.09%)
Mutual labels:  twitter-api, twitter
Autohook
Automatically setup and serve webhooks for the Twitter Account Activity API
Stars: ✭ 67 (-41.23%)
Mutual labels:  twitter-api, twitter
Likelo
Twitter auto like bot, Under Development👷, Pre Alpha
Stars: ✭ 64 (-43.86%)
Mutual labels:  twitter-api, twitter
Um Twitteremojianalysis
Twitter Emoji Analysis
Stars: ✭ 6 (-94.74%)
Mutual labels:  twitter-api, twitter
Tia
Your Advanced Twitter stalking tool
Stars: ✭ 98 (-14.04%)
Mutual labels:  twitter-api, twitter
Tweetinvi
Tweetinvi, an intuitive Twitter C# library for the REST and Stream API. It supports .NET, .NETCore, UAP (Xamarin)...
Stars: ✭ 812 (+612.28%)
Mutual labels:  twitter-api, twitter
Remote Dev Jobs Streamer
Match Tweets containing remote developer jobs using Filtered Stream and Tweet Annotations
Stars: ✭ 24 (-78.95%)
Mutual labels:  twitter-api, twitter
Twitter
Twitter API for Laravel 5.5+, 6.x, 7.x & 8.x
Stars: ✭ 755 (+562.28%)
Mutual labels:  twitter-api, twitter
Rtweet Workshop
Slides and code for the rtweet workshop
Stars: ✭ 41 (-64.04%)
Mutual labels:  twitter-api, twitter
Twitter Lite
A tiny, full-featured, flexible client / server library for the Twitter API
Stars: ✭ 611 (+435.96%)
Mutual labels:  twitter-api, twitter
Social Amnesia
Forget the past. Social Amnesia makes sure your social media accounts only show your posts from recent history, not from "that phase" 5 years ago.
Stars: ✭ 656 (+475.44%)
Mutual labels:  twitter-api, twitter
Twitter.jl
Julia package to access Twitter API
Stars: ✭ 58 (-49.12%)
Mutual labels:  twitter-api, twitter
Tweetview
This project is an example Android Twitter feed reader app from the Codehenge Android development tutorials.
Stars: ✭ 75 (-34.21%)
Mutual labels:  twitter-api, twitter

Getting Started |Build Status| |Code Climate| |PyPy Version|

Installation ''''''''''''

.. code:: bash

# installing the latest signed release
pip install twitter-ads

Quick Start '''''''''''

.. code:: python

from twitter_ads.client import Client
from twitter_ads.campaign import Campaign
from twitter_ads.enum import ENTITY_STATUS

CONSUMER_KEY = 'your consumer key'
CONSUMER_SECRET = 'your consumer secret'
ACCESS_TOKEN = 'access token'
ACCESS_TOKEN_SECRET = 'access token secret'
ACCOUNT_ID = 'account id'

# initialize the client
client = Client(
    CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)

# load the advertiser account instance
account = client.accounts(ACCOUNT_ID)

# load and update a specific campaign
campaign = account.campaigns().next()
campaign.name = 'updated campaign name'
campaign.entity_status = ENTITY_STATUS.PAUSED
campaign.save()

# iterate through campaigns
for campaign in account.campaigns():
    print(campaign.id)

Command Line Helper '''''''''''''''''''

.. code:: bash

# The twitter-ads command launches an interactive session for testing purposes
# with a client instance automatically loaded from your .twurlrc file.

~ ❯ twitter-ads

For more help please see our Examples and Guides_ or check the online Reference Documentation_.

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

.. code:: python

client = Client(
    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],
        'retry_on_timeouts': True,
        'timeout': (1.0, 3.0)
    })

.. list-table::

    • 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.

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.

.. code:: bash

# clone the repository
git clone [email protected]:twitterdev/twitter-python-ads-sdk.git
cd twitter-python-ads-sdk

# install dependencies
pip install -r requirements.txt

# installing a local unsigned release
pip install -e .

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.

.. _Examples and Guides: https://github.com/twitterdev/twitter-python-ads-sdk/tree/master/examples .. _Reference Documentation: http://twitterdev.github.io/twitter-python-ads-sdk/reference/index.html .. _semantic versioning: http://semver.org .. _Contributing Guidelines: https://github.com/twitterdev/twitter-python-ads-sdk/blob/master/CONTRIBUTING.rst .. _GitHub issue: https://github.com/twitterdev/twitter-python-ads-sdk/issues .. _send us: https://github.com/twitterdev/twitter-python-ads-sdk/blob/master/CONTRIBUTING.rst .. _Twitter Community Forums: https://twittercommunity.com/c/advertiser-api

.. |Build Status| image:: https://travis-ci.org/twitterdev/twitter-python-ads-sdk.svg?branch=master :target: https://travis-ci.org/twitterdev/twitter-python-ads-sdk .. |Code Climate| image:: https://codeclimate.com/github/twitterdev/twitter-python-ads-sdk/badges/gpa.svg :target: https://codeclimate.com/github/twitterdev/twitter-python-ads-sdk .. |PyPy Version| image:: https://badge.fury.io/py/twitter-ads.svg :target: http://badge.fury.io/py/twitter-ads

.. _Request: https://github.com/twitterdev/twitter-python-ads-sdk/blob/master/twitter_ads/http.py#L28 .. _Response: https://github.com/twitterdev/twitter-python-ads-sdk/blob/master/twitter_ads/http.py#L118 .. _error objects: https://github.com/twitterdev/twitter-python-ads-sdk/blob/master/twitter_ads/error.py .. |error-hierarchy| image:: http://i.imgur.com/XcLDWLO.png

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].