Cubes (OLAP server)


Cubes is a light-weight open source multidimensional modelling and OLAP toolkit for development reporting applications and browsing of aggregated data written in Python programming language released under the MIT License.
Cubes provides to an analyst or any application end-user "understandable and natural way of reporting using concept of data Cubesmultidimensional data objects".
Cubes was first publicly released in March 2011. The project was originally developed for Public Procurements of Slovakia. Cubes 1.0 was released in September 2014 and presented on the PyData Conference in New York

Features

The logical conceptual model in Cubes is described using JSON and can be provided either in a form of a file, directory bundle or from an external model provider. The basic model objects are: cubes and their measures and aggregates, dimensions and their attributes, hierarchies. Logical model also contains mapping from logical attributes to their physical location in a database.
Example model:

Operations

Cubes provides basic set of operations such as Data drilling and filtering. The operations can be accessed either through Python interface or through a light web server called Slicer.
Example of the python interface:

import cubes
workspace = Workspace
browser = workspace.browser
result = browser.aggregate
print

Server

The Cubes provides a non-traditional OLAP server with HTTP queries and JSON response API. Example query to get "total amount of all contracts between January 2012 and June 2016 by month":

http://localhost:5000/cube/contracts/aggregate?drilldown=date&drilldown=criteria&cut=date:2012,1-2012,6&order=date.month:desc

The response looks like:


The simple HTTP/JSON interface makes it very easy to integrate OLAP reports in web applications written in pure HTML and JavaScript.
The Slicer server contains endpoints describing the cube metadata which helps to create generic reporting applications that don't have to know the database model structure and conceptual hierarchies up-in-front.
The Slicer server is written using the Flask.

ROLAP and SQL

The built-in SQL backend of the framework provides ROLAP functionality on top a relational database. Cubes contains a SQL query generator that translates the reporting queries into SQL statements. The query generator takes into account topology of the star or snowflake schema and executes only joins that are necessary to retrieve attributes required by the data analyst.
The SQL backend uses SQLAlchemy Python toolkit to construct the queries.