Skip to main content

Twitter Streaming API utility for Python

I've released twitter-streamer ("Streamer") under the MIT license.

Streamer is a simple Python script that dumps tweets using Twitter's streaming API via the statuses/filter method.

By default, Streamer outputs the raw JSON text returned by Twitter's stream. It supports selective field output in CSV format as well, so you can choose to emit specific fields in a well-defined format.

Here's a quick example, using CSV output of the tweet id, user name, and the tweet text:

$ python streamer.py -n --f=id_str,user.name,text "Python"
267659457188749312,Python Questions,Tornado as proxy. Memory leak http://t.co/yiHfhaq4 #python
267659458828726272,Python Questions,How do I setup a global X/gnome key binding from a pygtk application? http://t.co/Agw0Isoi #python
267659464696545280,Python Questions,Python sorted() function and returning multiple values http://t.co/Iq7S2DJH #python
267659579150716928,Sheena Moore,"@mamasheena420 @CurrenSy_Spitta My 2 year old Wyatt, holding a Huge Python! Please Re Tweet me!!!"
267659605088276482,PythonAtSO,Python sorted() function and returning multiple values http://t.co/67zFlr31
267659721740267520,A. Babenhauserheide,"@rozzin #bash, #python, #ruby, #fortran and #assembler have less parentheses than #lisp. Except for python they all use the dreadful “end”…"

Interested? Check out Twitter Streamer on Github.