Cubes 0.10 Released
After a while, here is an update to Cubes - Python Lightweight OLAP framework for multidimensional modeling. There are some changes included that were mentioned in the EruoPython talk such as table_rows
and cross_table
.
I recommend to look at updated examples in the Github repository. The Flask example is now "real" example instead of "sandbox" example and you can see how to generate a simple table for dimension hierarchy browsing.
There is also a more complex example with star-like schema dataset in the cubes-examples github repository. Follow the instructions in README files how to make it running.
There are some backward incompatible changes in this release – until 1.0 the "point" releases will contain this kind of changes, as it is still evolving. You can find more information below.
Quick Summary
- Way how model is constructed has changed. Designated methods are
create_model()
orload_model()
- Dimension defition can have a "template". For example:
{ "name": "contract_date", "template": "date" }
- added
table_rows()
andcross_table()
to aggregation result for more convenient table creation. Thetable_rows
takes care of providing appropriate dimension key and label for browsed level. - added
simple_model(cube_name, dimension_names, measures)
Incompatibilities: use create_model()
instead of Model(**dict)
, if you
were using just load_model()
, you are fine.
New Features
- To address issue #8
create_model(dict)
was added as replacement forModel(**dict)
.Model()
from now on will expect correctly constructed model objects.create_model()
will be able to handle various simplifications and defaults during the construction process. - added
info
attribute to all model objects. It can be used to store custom, application or front-end specific information - preliminary implementation of
cross_table()
(interface might be changed) AggregationResult.table_rows()
- new method that iterates through drill-down rows and returns a tuple with key, label, path, and rest of the fields.- dimension in model description can specify another template dimension – all properties from the template will be inherited in the new dimension. All dimension properties specified in the new dimension completely override the template specification
- added
point_cut_for_dimension
- added
simple_model(cube_name, dimensions, measures)
– creates a single-cube model with flat dimensions from a list of dimension names and measures from a list of measure names. For example:
model = simple_model("contracts", ["year","contractor", "type"], ["amount"])
Slicer Server:
/cell
– return cell details (replaces/details
)
Changes
- creation of a model from dictionary through
Model(dict)
is depreciated, usecreate_model(dict)
instead. All initialization code will be moved there. Depreciation warnings were added. Old functionality retained for the time being. (important) - Replaced
Attribute.full_name()
withAttribute.ref()
- Removed
Dimension.attribute_reference()
as same can be achieved withdim(attr).ref()
AggregationResult.drilldown
renamed toAggregationResults.cells
(important)
Planned Changes:
str(Attribute)
will return ref() instead of attribute name as it is more useful
Fixes
- order of dimensions is now preserved in the Model
Links
Sources can be found on github. Read the documentation.
Join the Google Group for discussion, problem solving and announcements.
Submit issues and suggestions on github
IRC channel #databrewery on irc.freenode.net
If you have any questions, comments, requests, do not hesitate to ask.