-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'docs' of github.com:metamx/pydruid into docs
- Loading branch information
Showing
1 changed file
with
5 additions
and
24 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 |
---|---|---|
@@ -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 |