datasift-pythonPython client to interface with DataSift | |
Download |
datasift-python Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- MediaSift Ltd
- Publisher web site:
- https://github.com/datasift/
datasift-python Tags
datasift-python Description
datasift-python is the official Python library for accessing Datasift. See the examples folder for some simple example usage.All examples and tests use the username and API key in config.py.InstallationThe simplest way...easy_install datasiftFrom source...python setup.py installSimple exampleThis example looks for anything that contains the word "datasift" and simply prints the content to the screen as they come in.import sys, os, config, datasiftclass EventHandler(datasift.StreamConsumerEventHandler): def on_interaction(self, consumer, data, hash): print data def on_warning(self, consumer, message): print 'WARN: %s' % (message) def on_error(self, consumer, message): print 'ERR: %s' % (message)user = datasift.User(config.username, config.api_key)definition = user.create_definition('interaction.content contains "datasift"')consumer = definition.get_consumer(EventHandler(), 'http')consumer.consume()consumer.run_forever()See the DataSift documentation for full details of the data contained within each interaction. See this page on our developer site for an example tweet: http://dev.datasift.com/docs/targets/twitter/tweet-output-formatProduct's homepage
datasift-python Related Software