|
| 1 | +Getting Started |Build Status| |Code Climate| |PyPy Version| |
| 2 | +------------------------------------------------------------ |
| 3 | + |
| 4 | +Installation |
| 5 | +'''''''''''' |
| 6 | + |
| 7 | +.. code:: bash |
| 8 | +
|
| 9 | + # installing the latest signed release |
| 10 | + pip install twitter-ads |
| 11 | +
|
| 12 | +Quick Start |
| 13 | +''''''''''' |
| 14 | + |
| 15 | +.. code:: python |
| 16 | +
|
| 17 | + from twitter_ads.client import Client |
| 18 | + from twitter_ads.campaign import Campaign |
| 19 | +
|
| 20 | + CONSUMER_KEY = 'your consumer key' |
| 21 | + CONSUMER_SECRET = 'your consumer secret' |
| 22 | + ACCESS_TOKEN = 'access token' |
| 23 | + ACCESS_TOKEN_SECRET = 'access token secret' |
| 24 | + ACCOUNT_ID = 'account id' |
| 25 | +
|
| 26 | + # initialize the client |
| 27 | + client = Client( |
| 28 | + CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET) |
| 29 | +
|
| 30 | + # load the advertiser account instance |
| 31 | + account = client.accounts(id=ACCOUNT_ID) |
| 32 | +
|
| 33 | + # load and update a specific campaign |
| 34 | + campaign = account.campaigns().next() |
| 35 | + campaign.name = 'updated campaign name' |
| 36 | + campaign.paused = True |
| 37 | + campaign.save() |
| 38 | +
|
| 39 | + # iterate through campaigns |
| 40 | + for campaign in account.campaigns(): |
| 41 | + print(campaign.id) |
| 42 | +
|
| 43 | +
|
| 44 | +
|
| 45 | +Command Line Helper |
| 46 | +''''''''''''''''''' |
| 47 | + |
| 48 | +.. code:: bash |
| 49 | +
|
| 50 | + # The twitter-ads command launches an interactive session for testing purposes |
| 51 | + # with a client instance automatically loaded from your .twurlrc file. |
| 52 | +
|
| 53 | + ~ ❯ twitter-ads |
| 54 | +
|
| 55 | +For more help please see our `Examples and Guides`_ or check the online |
| 56 | +`Reference Documentation`_. |
| 57 | + |
| 58 | +Compatibility & Versioning |
| 59 | +-------------------------- |
| 60 | + |
| 61 | +This project is designed to work with Python 2.7 or greater. While it |
| 62 | +may work on other version of Python, below are the platform and runtime |
| 63 | +versions we officially support and regularly test against. |
| 64 | + |
| 65 | ++------------+----------------------+ |
| 66 | +| Platform | Versions | |
| 67 | ++============+======================+ |
| 68 | +| CPython | 2.7, 3.2, 3.3, 3.4 | |
| 69 | ++------------+----------------------+ |
| 70 | +| PyPy | 2.x, 4.x | |
| 71 | ++------------+----------------------+ |
| 72 | + |
| 73 | +All releases adhere to strict `semantic versioning`_. For Example, |
| 74 | +major.minor.patch-pre (aka. stick.carrot.oops-peek). |
| 75 | + |
| 76 | +Development |
| 77 | +----------- |
| 78 | + |
| 79 | +If you’d like to contribute to the project or try an unreleased |
| 80 | +development version of this project locally, you can do so quite easily |
| 81 | +by following the examples below. |
| 82 | + |
| 83 | +.. code:: bash |
| 84 | +
|
| 85 | + # clone the repository |
| 86 | + git clone [email protected]:twitterdev/twitter-python-ads-sdk.git |
| 87 | + cd twitter-python-ads-sdk |
| 88 | +
|
| 89 | + # install dependencies |
| 90 | + pip install -r requirements.txt |
| 91 | +
|
| 92 | + # installing a local unsigned release |
| 93 | + pip install -e . |
| 94 | +
|
| 95 | +We love community contributions! If you’re planning to send us a pull |
| 96 | +request, please make sure read our `Contributing Guidelines`_ first. |
| 97 | + |
| 98 | +Feedback and Bug Reports |
| 99 | +------------------------ |
| 100 | + |
| 101 | +Found an issue? Please open up a `GitHub issue`_ or even better yet |
| 102 | +`send us`_ a pull request. Have a question? Want to discuss a new |
| 103 | +feature? Come chat with us in the `Twitter Community Forums`_. |
| 104 | + |
| 105 | +License |
| 106 | +------- |
| 107 | + |
| 108 | +The MIT License (MIT) |
| 109 | + |
| 110 | +Copyright (C) 2015 Twitter, Inc. |
| 111 | + |
| 112 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 113 | +of this software and associated documentation files (the "Software"), to deal |
| 114 | +in the Software without restriction, including without limitation the rights |
| 115 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 116 | +copies of the Software, and to permit persons to whom the Software is |
| 117 | +furnished to do so, subject to the following conditions: |
| 118 | + |
| 119 | +The above copyright notice and this permission notice shall be included in all |
| 120 | +copies or substantial portions of the Software. |
| 121 | + |
| 122 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 123 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 124 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 125 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 126 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 127 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 128 | +SOFTWARE. |
| 129 | + |
| 130 | +.. _Examples and Guides: https://github.com/twitterdev/twitter-python-ads-sdk/tree/master/examples |
| 131 | +.. _Reference Documentation: http://twitterdev.github.io/twitter-python-ads-sdk/reference/index.html |
| 132 | +.. _semantic versioning: http://semver.org |
| 133 | +.. _Contributing Guidelines: https://github.com/twitterdev/twitter-python-ads-sdk/blob/master/CONTRIBUTING.rst |
| 134 | +.. _GitHub issue: https://github.com/twitterdev/twitter-python-ads-sdk/issues |
| 135 | +.. _send us: https://github.com/twitterdev/twitter-python-ads-sdk/blob/master/CONTRIBUTING.rst |
| 136 | +.. _Twitter Community Forums: https://twittercommunity.com/c/advertiser-api |
| 137 | + |
| 138 | +.. |Build Status| image:: https://travis-ci.org/twitterdev/twitter-python-ads-sdk.svg?branch=master |
| 139 | + :target: https://travis-ci.org/twitterdev/twitter-python-ads-sdk |
| 140 | +.. |Code Climate| image:: https://codeclimate.com/github/twitterdev/twitter-python-ads-sdk/badges/gpa.svg |
| 141 | + :target: https://codeclimate.com/github/twitterdev/twitter-python-ads-sdk |
| 142 | +.. |PyPy Version| image:: https://badge.fury.io/py/twitter-ads.svg |
| 143 | + :target: http://badge.fury.io/rb/twitter-ads |
0 commit comments