Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    python-twitter 0.8.5

    Download button

    No screenshots available
    Downloads: 717  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.8/5)
    16 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    DeWitt Clinton | More programs
    GPL / FREE
    April 18th, 2011, 12:32 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    python-twitter description

    A Python wrapper around the Twitter API

    python-twitter is a Python wrapper around the Twitter API.

    This library provides a pure python interface for the Twitter API.

    Twitter provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a web services API and this library is intended to make it even easier for python programmers to use.

    Building

    From source:

    Install the dependencies:

    http://cheeseshop.python.org/pypi/simplejson

    Download the latest python-twitter library from:

    http://code.google.com/p/python-twitter/

    Untar the source distribution and run:

    python setup.py build
    python setup.py install


    Testing

    With setuptools installed:

    python setup.py test

    Without setuptools installed:

    python twitter_test.py

    Usage:

    The library provides a python wrapper around the Twitter API and the twitter data model.

    Model:

    The three model classes are twitter.Status, twitter.User, and twitter.DirectMessage. The API methods return instances of these classes.

    To read the full API for twitter.Status, twitter.User, or twitter.DirectMessage, run:

    pydoc twitter.Status
    pydoc twitter.User
    pydoc twitter.DirectMessage


    API:

    The API is exposed via the twitter.Api class.

    To create an instance of the twitter.Api class:

    >>> import twitter
    >>> api = twitter.Api()


    To create an instance of the twitter.Api with login credentials (many API calls required the client to be authenticated):

    >>> api = twitter.Api(username='username', password='password)

    To fetch the most recently posted public twitter status messages:

    >>> statuses = api.GetPublicTimeline()
    >>> print [s.user.name for s in statuses]
    [u'DeWitt', u'Kesuke Miyagi', u'ev', u'Buzz Andersen', u'Biz Stone']


    To fetch a single user's public status messages, where "user" is either a Twitter "short name" or their user id.

    >>> statuses = api.GetUserTimeline(user)
    >>> print [s.text for s in statuses]


    To fetch a list a user's friends (requires authentication):

    >>> users = api.GetFriends()
    >>> print [u.name for u in users]


    To post a twitter status message (requires authentication):

    >>> status = api.PostUpdate(username, password, 'I love python-twitter!')
    >>> print status.text
    I love python-twitter!


    There are many more API methods, to read the full API documentation:

    pydoc twitter.Api

    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Lots of changes have been happening on Github.
    · This version is the last v1.0 API release and it's being made to push to PyPI and other places.
    · All work now will be on getting the v1.1 API supported.

      


    TAGS:

    Python wrapper | Twitter API | Python library | Python | Twitter | API

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM