Skip to content

Commit

Permalink
Merge branch 'docs' of github.com:metamx/pydruid into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Deep Ganguli committed Mar 6, 2014
2 parents df90783 + eb4f4a2 commit 8f9b45d
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 8f9b45d

Please sign in to comment.