UserSpace

class UserSpace(_impl)[source]

Container of cells, other spaces, and cells namespace.

UserSpace objects can contain cells and other spaces. Spaces have mappings of names to objects that serve as global namespaces of the formulas of the cells in the spaces.

Basic properties

name

Name of the object.

fullname

Dotted name of the object.

doc

Description string

allow_none

Whether a cells can have None as its value.

model

The model this object belongs to.

parent

The parent of this object.

properties

refs

A map associating names to objects accessible by the names.

has_params()

Check if the parameter function is set.

set_property(name, value)

Set property name

Space operations

copy(parent[, name, defined_only])

Make a copy of itself

Inheritance operations

bases

List of base classes.

add_bases(*bases)

Add base spaces.

remove_bases(*bases)

Remove base spaces.

Child Space operations

spaces

A mapping associating names to named spaces.

named_spaces

A mapping associating names to named spaces.

static_spaces

A mapping associating names to named spaces.

cur_space([name])

Set the current space to Space name and return it.

import_module([module, recursive])

Create a child space from an module.

new_space([name, bases, formula, refs])

Create a child space.

new_space_from_csv(filepath[, space, cells, …])

Create spaces from from a comma-separated values (csv) file.

new_space_from_excel(book, range_[, sheet, …])

Create a child space from an Excel range.

new_space_from_module(module[, recursive])

Create a child space from an module.

new_space_from_pandas(obj[, space, cells, …])

Create child spaces from Pandas DataFrame or Series.

reload()

Reload the source module and update the formulas.

Child Cells operations

cells

A mapping of cells names to the cells objects in the space.

new_cells([name, formula])

Create a cells in the space.

new_cells_from_csv(filepath[, cells, param])

Create cells from a comma-separated values (csv) file.

new_cells_from_excel(book, range_[, sheet, …])

Create multiple cells from an Excel range.

new_cells_from_module(module)

Create a cells from a module.

new_cells_from_pandas(obj[, cells, param])

Create new cells from Pandas Series or DataFrame object.

import_funcs(module)

Create a cells from a module.

ItemSpace operations

itemspaces

A mapping of arguments to ItemSpace objects.

parameters

A tuple of parameter strings.

formula

Property to get, set, delete formula.

set_formula(formula)

Set if the parameter function.

del_formula()

Delete formula

clear_all()

Delete all child ItemSpace objects

clear_at(*args, **kwargs)

Delete a child ItemSpace object

node(*args, **kwargs)

Return a Element object for the given arguments.

preds(*args, **kwargs)

Return a list of predecessors of a cell.

succs(*args, **kwargs)

Return a list of successors of a cell.

Exporting to Pandas objects

frame

Alias of to_frame().

to_frame(*args)

Convert the space itself into a Pandas DataFrame object.