Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs. http://stackoverflow.com/questions/tagged/twython
Find a file
2010-02-25 02:14:14 -05:00
examples New package structure; twython is now separated out into core/oauth/streaming. To maintain compatibility with older Twython versions, simply import twython like: 'import twython.core as twython' - this will allow for easier oauth/streaming development, and should hopefully fix a lot of the installation issues people kept running into with easy_install 2009-12-17 03:05:39 -05:00
twython Increment version number to 1.2; fixed a bug in updateProfileColors() wherein multiple values wouldn't get properly concatenated/url-encoded. Changed getRateLimitStatus() to accept a boolean of 'checkRequestingIP', which should hopefully make the method a little more clear for debugging purposes. 2010-02-25 02:14:14 -05:00
twython3k Increment version number to 1.2; fixed a bug in updateProfileColors() wherein multiple values wouldn't get properly concatenated/url-encoded. Changed getRateLimitStatus() to accept a boolean of 'checkRequestingIP', which should hopefully make the method a little more clear for debugging purposes. 2010-02-25 02:14:14 -05:00
.gitignore New package structure; twython is now separated out into core/oauth/streaming. To maintain compatibility with older Twython versions, simply import twython like: 'import twython.core as twython' - this will allow for easier oauth/streaming development, and should hopefully fix a lot of the installation issues people kept running into with easy_install 2009-12-17 03:05:39 -05:00
LICENSE Changed licensing, modified contents of setup.py to conform to what Pypi wants/needs 2009-07-28 23:22:52 -04:00
README.markdown Properly instantiating an instance of twython.core in the README example 2009-12-17 03:30:34 -05:00
setup.py Increment version number to 1.2; fixed a bug in updateProfileColors() wherein multiple values wouldn't get properly concatenated/url-encoded. Changed getRateLimitStatus() to accept a boolean of 'checkRequestingIP', which should hopefully make the method a little more clear for debugging purposes. 2010-02-25 02:14:14 -05:00

Twython - Easy Twitter utilities in Python

I wrote Twython because I found that other Python Twitter libraries weren't that up to date. Certain things like the Search API, OAuth, etc, don't seem to be fully covered. This is my attempt at a library that offers more coverage.

This is my first library I've ever written in Python, so there could be some stuff in here that'll make a seasoned Python vet scratch his head, or possibly call me insane. It's open source, though, and I'm open to anything that'll improve the library as a whole.

OAuth and Streaming API support is in the works, but every other part of the Twitter API should be covered. Twython handles both Basic (HTTP) Authentication and OAuth (Older versions (pre 0.9) of Twython need Basic Auth specified - to override this, specify 'authtype="Basic"' in your twython.setup() call).

Twython has Docstrings if you want function-by-function plays; otherwise, check the Twython Wiki or Twitter's API Wiki (Twython calls mirror most of the methods listed there).

Requirements

Twython (for versions of Python before 2.6) requires a library called "simplejson". You can grab it at the following link:

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

Installation

Installing Twython is fairly easy. You can...

easy_install twython

...or, you can clone the repo and install it the old fashioned way.

git clone git://github.com/ryanmcgrath/twython.git
cd twython
sudo python setup.py install

Example Use

import twython

twitter = twython.core.setup(username="example", password="example")
twitter.updateStatus("See how easy this was?")

Twython 3k

There's an experimental version of Twython that's made for Python 3k. This is currently not guaranteed to work, but it's provided so that others can grab it and hack on it. If you choose to try it out, be aware of this.

Questions, Comments, etc?

My hope is that Twython is so simple that you'd never have to ask any questions, but if you feel the need to contact me for this (or other) reasons, you can hit me up at ryan@venodesigns.net.

Twython is released under an MIT License - see the LICENSE file for more information.