Skip to content

Instantly share code, notes, and snippets.

@pudo
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pudo/e22f2fa135eba57f514b to your computer and use it in GitHub Desktop.
Save pudo/e22f2fa135eba57f514b to your computer and use it in GitHub Desktop.
import math
from pprint import pprint
#from cubes.model import Cell
from openspending.core import create_app
from openspending.model import Dataset
app = create_app()
with app.app_context():
workspace = app.cubes_workspace
#print workspace.list_cubes()
dataset = Dataset.by_name('openspending-example')
res = aggregate(dataset, cuts=[('to', 'chesterfield-associates')], drilldowns=[])
pprint(res)
#browser = workspace.browser('openspending-example')
#print browser, dir(browser)
#res = browser.aggregate(drilldown=['transactionid'])
#print res, res.summary
#print list(res)
#for fact in browser.facts():
# pprint(fact)
#fact = nestify(browser.fact('1657328893f2e40e868e707c1402af99ecad5286'))
#pprint(fact)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment