Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DataSift Python Client Library

This is an unofficial Python library for Datasift.

It currently supports compiling CSDLs via the REST API and consuming an HTTP Stream via the Streaming API.

Requirements

Example

fromdatasiftimport (
DataSiftUser,
DataSiftDefinition,
DataSiftStream,
DataSiftStreamListener
)
# Fill in account credentialsDATASIFT_USERNAME="my_username"DATASIFT_API_KEY="my_api_key"# Create useruser=DataSiftUser(DATASIFT_USERNAME, DATASIFT_API_KEY)
# Create, compile CSDLcsdl='interaction.type == "twitter" and '\
'(interaction.content contains "skrillex")'definition=DataSiftDefinition(csdl, user)
definition.compile()
# Define listenerclassMyListener(DataSiftStreamListener):
defon_data(self, data):
printdata# Create stream, listenlistener=MyListener()
stream=DataSiftStream(listener, definition, user)
stream.listen()

License

All code is released under the MIT license. Please read the LICENSE.txt file for more details.

Acknowledgements

Thanks to joshthecoder and his tweepy library for demonstrating HTTP stream consumption via httplib.

About

A Python client library for DataSift

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages