Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from 3ft9/develop
Browse files Browse the repository at this point in the history
README.md file and setuptools distribution.
  • Loading branch information
quipo committed Mar 9, 2012
2 parents df7dfc7 + 3643464 commit a32f5c2
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 0 deletions.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
DataSift Python Client Library
==============================

This is the official Python library for accessing [Datasift](http://datasift.com/). See the examples
folder for some simple example usage.

All examples and tests use the username and API key in config.py.

Installation
------------

The simplest way...

# easy_install datasift

From source...

# python setup.py install

Simple example
--------------

This example looks for anything that contains the word "datasift" and simply
prints the content to the screen as they come in.

```python
import sys, os, config, datasift

class EventHandler(datasift.StreamConsumerEventHandler):
def on_interaction(self, consumer, data, hash):
print data['interaction']['content']
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-format

Requirements
------------

* Python 2.4+

License
-------

All code contained in this repository is Copyright 2012 MediaSift Ltd.

This code is released under the BSD license. Please see the LICENSE file for
more details.

Changelog
---------

* v.0.1.1 Initial release (2012-03-09)
28 changes: 28 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# encoding: utf-8

import os
from setuptools import setup
from datasift import __version__

setup(
name = "datasift",
version = __version__,
author = "Stuart Dallas",
author_email = "stuart@3ft9.com",
maintainer = "MediaSift Ltd",
maintainer_email = "opensource@datasift.com",
description = ("The official DataSift API library for Python."),
license = "Copyright (C) 2012 by MediaSift Ltd. All Rights Reserved. See LICENSE for the full license.",
url = "https://github.com/datasift/datasift-python",
packages=['datasift', 'tests'],
include_package_data = True,
platforms='any',
classifiers=[
"Development Status :: 4 - Beta",
"Framework :: Setuptools Plugin",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)
4 changes: 4 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""
To run all tests that use a mock ApiClient type 'python run_tests.py'.
To run tests against the live API type 'python test_live_api.py'.
"""
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a32f5c2

Please sign in to comment.