Skip to main content

Grabs Datasift preview stats and writes them out to stdout

Project description

A script to fetch datasift preview stats for a particular hash, over a particular date range.

Quick Start

If you have Python and virtualenv installed, the simplest way to get set up is to clone or download all the source files, cd into the directory and then run these commands for first time::

$ virtualenv .env
$ source .env/bin/activate
$ python setup.py install

That will install everything you need to run the script.

Running the Script

Usage: datasift_preview_grabber <start_date> <end_date> <stream_hash> <datasift-username> <datasift-apikey>

Where:
    start_date and end_date are in the format yyyy-mm-dd

The script will split the date range you give it into individual days (a limitation of the Datasift Preview service as it stands). Each day costs 20DPU currently so don’t go mental with your date range!

For each day, the script creates a preview job with Datasift. The script waits for each job to finish, which can take a while. When all the jobs are finished, the results of them are simply printed to stdout.

Developing the Script Further

If you want to enhance the script in some way, install the libraries from the test_requirements.txt in the virtualenv you created earlier and make sure the tests all pass before adding something new::

$ pip install -r test_requirements.txt
$ nosetests

If it’s useful, send it back to us in the form of a pull request on Github!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasift_preview_grabber-0.0.0.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file datasift_preview_grabber-0.0.0.tar.gz.

File metadata

File hashes

Hashes for datasift_preview_grabber-0.0.0.tar.gz
Algorithm Hash digest
SHA256 1cc645cf8c609ed4772301bf9c0820a5352a6115fd532d0173315816b5c15e35
MD5 b5b160542bb850d8b0f7e7844f6a1e3c
BLAKE2b-256 2612bccf4a23151a98aedebace8e075ec7890c3a84e8154f690895c74842c3c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page