Workspace Reference

Workspace manages all cubes, their data stores and model providers.

class cubes.Workspace(config=None, stores=None)

Creates a workspace. config should be a ConfigParser or a path to a config file. stores should be a dictionary of store configurations, a ConfigParser or a path to a stores.ini file.

add_model(model, name=None, store=None, translations=None)

Registers the model in the workspace. model can be a metadata dictionary, filename, path to a model bundle directory or a URL.

If name is specified, then it is used instead of name in the model. store is an optional name of data store associated with the model.

Model is added to the list of workspace models. Model provider is determined and associated with the model. Provider is then asked to list public cubes and public dimensions which are registered in the workspace.

No actual cubes or dimensions are created at the time of calling this method. The creation is deffered until cubes.Workspace.cube() or cubes.Workspace.dimension() is called.

add_slicer(name, url, **options)

Register a slicer as a model and data provider.

browser(cube, locale=None, identity=None)

Returns a browser for cube.

close()

Closes the workspace with all open stores and other associated resources.

cube(name, identity=None)

Returns a cube with name

cube_features(cube, identity=None)

Returns browser features for cube

dimension(name, provider=None)

Returns a dimension with name. Raises NoSuchDimensionError when no model published the dimension. Raises RequiresTemplate error when model provider requires a template to be able to provide the dimension, but such template is not a public dimension.

get_store(name='default')

Opens a store name. If the store is already open, returns the existing store.

Links dimensions to the cube in the context of model with help of provider.

list_cubes(identity=None)

Get a list of metadata for cubes in the workspace. Result is a list of dictionaries with keys: name, label, category, info.

The list is fetched from the model providers on the call of this method.

If the workspace has an authorizer, then it is used to authorize the cubes for identity and only authorized list of cubes is returned.

register_default_store(type_, **config)

Convenience function for registering the default store. For more information see register_store()

register_store(name, type_, **config)

Adds a store configuration.

Previous topic

Authenticators and Authorizers

Next topic

Model Reference

This Page