If you haveĪ program that uses python-twitter and would like a link in the documentation, In particular, having more example scripts would be a huge help. Patches, pull requests, and bug reports are welcome, just please keep the style consistent with the original source. Or check out the inline documentation with: $ pydoc twitter.Api There are many more API methods, to read the full API documentation eitherĬheck out the documentation on readthedocs, build the documentation locally To post a Twitter status message: > status = api.PostUpdate('I love python-twitter!') To fetch a list of a user's friends: > users = api.GetFriends() To fetch a single user's public status messages, where user is a Twitter user's screen name: > statuses = api.GetUserTimeline(screen_name=user) NOTE: much more than the small sample given here will print To see if your credentials are successful: > print(api.Verif圜redentials()) > api = twitter.Api(consumer_key='consumer_key',Īccess_token_secret='access_token_secret') To create an instance of the twitter.Api with login credentials (Twitter now requires an OAuth Access Token for all API calls): > import twitter use the helper script get_access_token.pyįor full details see the Twitter OAuth Overview.Generate a token to access your own account.To generate an Access Token you have to pick what type of access your application requires and then do one of the following: Please see the "Getting Started" guide on for more information. Therefore, you will need to register an app with Twitter in order to use this library. As of Twitter's API v1.1, authentication is required for most, if not all, endpoints. The python-twitter requires the use of OAuth keys for nearly all operations. The API is exposed via the twitter.Api class. To read the documentation for any of these models, run: $ pydoc twitter. See the django template tags available for use with python-twitter: Models The library utilizes models to represent various data structures returned by Twitter. Using with DjangoĪdditional template tags that expand tweet urls and urlize tweet text. To get started, check out the examples in the examples/ folder or read the documentation at which contains information about getting your authentication keys from Twitter and using the library. The library provides a Python wrapper around the Twitter API and the Twitter data model. You can view Twitter's API documentation at: Using View the latest python-twitter documentation at To run the unit tests against a set of Python versions: $ make tox To also run code coverage: $ make coverage To run the unit tests with a single Python version: $ make test Note that tests require `pip install pytest` and optionally `pip install pytest-cov` (these are included if you have installed dependencies from ``) The test suite can be run against a single Python version or against a range of them depending on which Makefile target you select. With pip install python-twitter) run: $ make env To install the minimal dependencies for production use (i.e., what is installed Note that `make dev` will install into your local `pyenv` all of the versions needed for test runs using `tox`. To install dependencies, run either: $ make dev Getting the codeĬheck out the latest development version anonymously with: $ git clone git:///bear/python-twitter.git If you are using python-twitter on Google App Engine, see more information about including 3rd party vendor library dependencies in your App Engine project. You can install python-twitter using: $ pip install python-twitter Twitter exposes a web services API and this library is intended to make it even easier for Python programmers to use. Twitter provides a service that allows people to connect via the web, IM, and SMS. It works with Python versions from 2.7+ and Python 3. This library provides a pure Python interface for the Twitter API. By the Python-Twitter Developers Introduction
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |