Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dganguli committed Mar 6, 2014
1 parent 458b82e commit eb4f4a2
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
===========
pyDruid
===========
#pydruid
pydruid exposes a simple API to create, execute, and analyze [Druid](http://druid.io/) queries. pydruid can parse query results into [Pandas](http://pandas.pydata.org/) DataFrame objects for subsequent data analysis -- this offers a tight integration between [Druid](http://druid.io/), the [SciPy](http://www.scipy.org/stackspec.html) stack (for scientific computing) and [scikit-learn](http://scikit-learn.org/stable/) (for machine learning). Additionally, pydruid can export query results into TSV or JSON for further processing with your favorite tool, e.g., R, Julia, Matlab, Excel.

pyDruid provides a python interface to the Druid analytic store. Typical usage
often looks like this::
#setup

#!/usr/bin/env python
#documentation

from pydruid.client import *

# Druid Config
endpoint = 'druid/v2/?pretty'
demo_bard_url = 'http://localhost:8083'
dataSource = 'wikipedia'
intervals = ["2013-01-01/p1y"]

query = pyDruid(demo_bard_url, endpoint)

counts = query.timeseries(dataSource = dataSource,
granularity = "minute",
intervals = intervals,
aggregations = {"count" : doubleSum("edits")}
)

print counts
[{'timestamp': '2013-09-30T23:31:00.000Z', 'result': {'count': 0.0}}, {'timestamp': '2013-09-30T23:32:00.000Z', 'result': {'count': 0.0}}, {'timestamp': '2013-09-30T23:33:00.000Z', 'result': {'count': 0.0}}, {'timestamp': '2013-09-30T23:34:00.000Z', 'result': {'count': 0.0}}]
#examples

0 comments on commit eb4f4a2

Please sign in to comment.