-
Notifications
You must be signed in to change notification settings - Fork 8
ChileCube
This is a global class, and connect with DataChile website data.
FYI: cube_id is considerated like cube.name. More information about cubes in https://datachile.io/about/api
Get list of cubes availables in DataChile
Get list of dimensions, measures and annotations availables in a cube.
Return a list with all Dimensions, Hierarchies and Levels that are found in the cube. Besides, drilldown property return a list with [ dimension, hierarchy, level ] that is used in .get().
[
{
"dimension": "Date",
"hierarchy": "Date",
"level": "Year",
"drilldown": ["Date", "Date", "Year"]
},
...
{
"dimension": "Tax Geography",
"hierarchy": "Geography",
"level": "Region",
"drilldown": ["Tax Geography", "Geography", "Region"]
}
]
Return list of comunas availables in DataChile.
[
{
"comuna_id": 1,
"comuna": "Concepción",
"region_id": 1,
"region": "Biobío"
}
]
Return list of regions availables in DataChile.
For an particular cube, get the members belonging to a certain level in a dimension.
Return tidy data from cube.
By default, params are:
params={
"drilldowns": [],
"measures": [],
"cuts": [
{
"drilldown": [],
"values": []
}
],
"parents": False
}
* Always you must define at least one drilldown and one measure.
By default, data return like a dict, but you can set df=True for to return like a pandas DataFrame
Get list of measures availables in a certain cube
[
{
"name": "Output",
"caption": "Output",
"annotations": {},
"full_name": "[Measures].[Output]",
"aggregator": "SUM"
},
...
{
"name": "Investment",
"caption": "Investment",
"annotations": {},
"full_name": "[Measures].[Investment]",
"aggregator": "SUM"
}
]