This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from 3ft9/develop
README.md file and setuptools distribution.
- Loading branch information
Showing
8 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.