rwa package

rwa.storable module

class rwa.storable.CallStack

Bases: object

Stack of peek or poke calls.

(De-)serialized object names are recorded so that the top peek() or poke() call can report the stack of object names till that of the object that raised an exception.

Each generic peek() or poke() call should first get the pointer, call the add() method (that actually returns the pointer) and then set the pointer back to its original value before each child peek() or poke() call.

add(record)
clear()
exception(exc)
pointer
pop()
stack
exception rwa.storable.ConflictingVersionWarning

Bases: Warning

class rwa.storable.Storable(python_type, key=None, handlers=[])

Bases: object

Describes a storable class.

python_type

type of the object to serialize.

Type:type
storable_type

unique identification string.

Type:str
_handlers

list of handlers.

Type:list
_parent

service which the storable instance is registered in.

Type:StorableService

Note that different copies of a storable instance should be registered into distinct services.

asVersion(version=None)
default_version

Default version (tuple) or None. Read-only property to be overloaded.

If returns None, the latest version/handler will be selected.

Example implementations:

class MyStorable(Storable):
    @property
    def default_version(self):
        if self.params.get('my_module.my_boolean_option', None):
            return (2,) # default version is number 2

class MyStorable(Storable):
    @property
    def default_version(self):
        if sys.version_info[0] == 2: # if Python 2
            # return earliest version instead of latest
            return min([ h.version for h in self.handlers ])
handlers
hasVersion(version)
params
peek(*args, **kwargs)
poke(*args, **kwargs)
python_type
storable_type
class rwa.storable.StorableHandler(version=None, exposes={}, peek=None, poke=None, peek_option=None, poke_option=None)

Bases: object

Defines how to store an object of the class identified by _parent.

version

version number.

Type:tuple
exposes

list of attributes to get/set.

Type:iterable
_peek

read object from store. To be called through peek().

Type:callable
_poke

write object in store. To be called through poke().

Type:callable
_parent

storable instance this handler is associated to.

Type:Storable
_peek_option

keys of service-wide parameters to be passed to _peek. To be accessed through property peek_option.

Type:set
_poke_option

keys of service-wide parameters to be passed to _poke. To be accessed through property poke_option.

Type:set

peek_option and poke_option are keys in the service’s params parameters which values are passed by peek() and poke() to _peek and _poke respectively, as keyword arguments if not already defined.

A parameter key is supposed to be a dot-separated sequence of keywords, e.g. 'my_module.my_option'. The keyword passed to peek() or poke() will be the substring after the last dot. If peek_option is ['my_module.my_option'], then peek() will receive the my_option=params['my_module.my_option'] argument (where params is the service-wide params parameters) if my_option is not already passed from the caller’s context and ‘my_module.my_option’ is defined in params.

exposes
peek(*args, **kwargs)
peek_option
poke(*args, **kwargs)
poke_option
python_type
storable_type
version
class rwa.storable.StorableService(params={})

Bases: object

Service for storable instances.

by_python_type

dictionnary of storable instances with types as keys.

Type:dict
by_storable_type

dictionnary of storable instances with identification strings as keys.

Type:dict
params

mutable map of global parameters shared with all the registered storable instances.

Type:dict
byPythonType(t, istype=False)
byStorableType(t)
by_python_type
by_storable_type
hasPythonType(t, istype=False)
hasStorableType(t)
params
registerStorable(storable, replace=False, agnostic=False, deprivatize=None)
class rwa.storable.StoreBase(storables)

Bases: rwa.storable.StorableService

Proxy class to StorableService that defines two abstract methods to be implemented for each concrete store.

storables

wrapped storable service.

Type:StorableService
byPythonType(t, istype=False)
byStorableType(t)
by_python_type
by_storable_type
hasPythonType(t)
hasStorableType(t)
peek(objname, container, _stack=None)

Reads from a container.

Parameters:
  • objname (str) – object name.
  • container (any) – address of the object in the store.
  • _stack (CallStack) – stack of parent object names.
Returns:

deserialized object.

Return type:

any

poke(objname, obj, container, visited=None, _stack=None)

Writes in a container.

Parameters:
  • objname (str) – object name.
  • obj (any) – object to serialize.
  • container (any) – address of the object in the store.
  • visited (dict) – already seriablized objects.
  • _stack (CallStack) – stack of parent object names.
registerStorable(storable, **kwargs)
storables
exception rwa.storable.TypeErrorWithAlternative(instead_of, use)

Bases: TypeError

rwa.storable.copy_handler(handler)
rwa.storable.copy_storable(storable, constructor=None)
rwa.storable.format_type(python_type, agnostic=False, deprivatize=False)
rwa.storable.from_version(v)
rwa.storable.to_version(v)

rwa.generic module

exception rwa.generic.AutoSerialFailure(msg=None, typ=None)

Bases: NotImplementedError

class rwa.generic.ExplicitNone

Bases: object

new in 0.8.5

class rwa.generic.GenericStore(storables, verbose=False)

Bases: rwa.storable.StoreBase

Abstract class for stores.

Implements the poke() and peek() methods with support for duplicate references and call stack (error reporting). Every other poke/peek functions should call these high-level methods to (de-)serialize children attributes.

poke() and peek() delegate to specialized variants such as pokeNative() and pokeStorable() (or their peek counterparts). Children attribute names are also converted into record references in these high-level methods.

defaultStorable(python_type=None, storable_type=None, version=None, **kwargs)

Generate a default storable instance.

Parameters:
  • python_type (type) – Python type of the object.
  • storable_type (str) – storable type name.
  • version (tuple) – version number of the storable handler.
Returns:

storable instance.

Return type:

StorableHandler

Extra keyword arguments are passed to registerStorable().

diagnosePeekFailure(container, record, _type, version, exception)
formatRecordName(objname)

Convert a record name into a record reference.

abstract method

The term record reference refers to the address of the record in the store as it can be natively understood by the underlying store.

Parameters:objname (str) – record/object name.
Returns:
record reference for use in all peek/poke methods except
the main peek() and poke() methods.
Return type:any

See also strRecord().

getRecord(objname, container)

Record getter.

abstract method

Parameters:
  • objname (any) – record reference.
  • container (any) – parent container.
Returns:

record or container.

Return type:

any

getRecordAttr(attr, record)

Record attribute getter.

abstract method

Parameters:
  • attr (str) – attribute name.
  • record (any) – record.
Returns:

attribute string value.

Return type:

str

isNativeType(obj)

Tell whether an object can be natively serialized.

If True, poke() delegates to pokeNative(). Otherwise, poke() delegates to tryPokeAny().

The default implementation returns True.

isStorable(record)
iterObjectNames(container)
newContainer(objname, obj, container)

Make a new container.

abstract method

Parameters:
  • objname (any) – record reference.
  • obj (any) – object to be serialized into the record; useful only if the type of the record depends on the nature of the object.
  • container (any) – container.
Returns:

reference (address in the store) of the new container.

Return type:

any

peek(objname, container, _stack=None, **kwargs)

Reads from a container.

Parameters:
  • objname (str) – object name.
  • container (any) – address of the object in the store.
  • _stack (CallStack) – stack of parent object names.
Returns:

deserialized object.

Return type:

any

peekNative(record)

Let the underlying store deserialize an object.

abstract method

See also pokeNative().

peekStorable(storable, record, _stack=None, **kwargs)
Parameters:
  • storable (StorableHandler) – storable instance.
  • record (any) – record.
  • _stack (CallStack) – stack of parent object names.
Returns:

deserialized object.

Return type:

any

Trailing keyword arguments are passed to the Storable instance’s peek.

poke(objname, obj, record, visited=None, _stack=None, **kwargs)

Writes in a container.

Parameters:
  • objname (str) – object name.
  • obj (any) – object to serialize.
  • container (any) – address of the object in the store.
  • visited (dict) – already seriablized objects.
  • _stack (CallStack) – stack of parent object names.
pokeNative(objname, obj, container)

Let the underlying store serialize an object.

abstract method

Parameters:
  • objname (any) – record reference.
  • obj (any) – object to be serialized.
  • container (any) – container or record.

For stores with dict-like interface, pokeNative() can be thought as:

container[objname] = obj

See also peekNative().

pokeStorable(storable, objname, obj, container, visited=None, _stack=None, **kwargs)
Parameters:
  • storable (StorableHandler) – storable instance.
  • objname (any) – record reference.
  • obj (any) – object to be serialized.
  • container (any) – container.
  • visited (dict) – map of the previously serialized objects that are passed by references; keys are the objects’ IDs.
  • _stack (CallStack) – stack of parent object names.

Trailing keyword arguments are passed to the Storable instance’s poke.

pokeVisited(objname, obj, record, existing, visited=None, _stack=None, **kwargs)

Serialize an already serialized object.

If the underlying store supports linking, this is the place where to make links.

The default implementation delegates to pokeStorable() or pokeNative().

Parameters:
  • objname (any) – record reference.
  • obj (any) – object to be serialized.
  • existing (any) – absolute reference of the record which the object was already serialized into.
  • visited (dict) – already serialized objects.
  • _stack (CallStack) – stack of parent object names.
registerStorable(storable)
setRecordAttr(attr, val, record)

Record attribute setter.

abstract method

Parameters:
  • attr (str) – attribute name.
  • val (str) – attribute string value.
  • record (any) – record.
strRecord(record, container)

Convert a record reference from a container into a string.

The default implementation considers string record references that do not require convertion.

See also formatRecordName().

tryPokeAny(objname, obj, record, visited=None, _stack=None, **kwargs)

First try to poke with pokeNative(). If this fails, generate a default storable instance and try with pokeStorable() instead.

abstract method

See also pokeStorable() for a description of the input arguments.

See also isNativeType() for how to route an object through tryPokeAny().

verbose
rwa.generic.assoc_to_list(assoc)
rwa.generic.default_peek(python_type, exposes)

Autoserializer factory.

Works best in Python 3.

Parameters:
  • python_type (type) – type constructor.
  • exposes (iterable) – sequence of attributes.
Returns:

deserializer (peek routine).

Return type:

callable

rwa.generic.default_storable(python_type, exposes=None, version=None, storable_type=None, peek=<function default_peek>)

Default mechanics for building the storable instance for a type.

Parameters:
  • python_type (type) – type.
  • exposes (iterable) – attributes exposed by the type.
  • version (tuple) – version number.
  • storable_type (str) – universal string identifier for the type.
  • peek (callable) – peeking routine.
Returns:

storable instance.

Return type:

Storable

rwa.generic.fail_peek(unsupported_type)
rwa.generic.fake_poke(*args, **kwargs)
rwa.generic.force_auto(service, _type)

Helper for forcing autoserialization of a datatype with already registered explicit storable instance.

Parameters:
  • service (StorableService) – active storable service.
  • _type (type) – type to be autoserialized.

Not tested

rwa.generic.handler(init, exposes, version=None)

Simple handler with default peek and poke procedures.

Parameters:
  • init (callable) – type constructor.
  • exposes (iterable) – attributes to be (de-)serialized.
  • version (tuple) – version number.
Returns:

storable handler.

Return type:

StorableHandler

rwa.generic.isreference(a)

Tell whether a variable is an object reference.

Due to garbage collection, some objects happen to get the id of a distinct variable. As a consequence, linking is not ready yet and isreference returns False.

rwa.generic.kwarg_storable(python_type, exposes=None, version=None, storable_type=None, init=None, args=[])

Deprecated

rwa.generic.lookup_type(storable_type)

Look for the Python type that corresponds to a storable type name.

rwa.generic.most_exposes(python_type)

Core engine for the automatic generation of storable instances.

Finds the attributes exposed by the objects of a given type.

Mostly Python3-only. Does not handle types which __new__ method requires extra arguments either.

Parameters:python_type (type) – object type.
Returns:attributes exposed.
Return type:list
rwa.generic.namedtuple_exposes(_type)
rwa.generic.namedtuple_storable(namedtuple, *args, **kwargs)

Storable factory for named tuples.

rwa.generic.not_storable(_type)

Helper for tagging unserializable types.

Parameters:_type (type) – type to be ignored.
Returns:storable instance that does not poke.
Return type:Storable
rwa.generic.peek(init, exposes, debug=False)

Default deserializer factory.

Parameters:
  • init (callable) – type constructor.
  • exposes (iterable) – attributes to be peeked and passed to init.
Returns:

deserializer (peek routine).

Return type:

callable

rwa.generic.peek_OrderedDict(s, c, _stack=None)
rwa.generic.peek_as_dict(store, container, _stack=None)
rwa.generic.peek_assoc(store, container, _stack=None)

Deserialize association lists.

rwa.generic.peek_deque(s, c, _stack=None)
rwa.generic.peek_dict(s, c, _stack=None)
rwa.generic.peek_frozenset(s, c, _stack=None)
rwa.generic.peek_list(s, c, _stack=None)
rwa.generic.peek_native(make)

Deserializer factory for types which state can be natively serialized.

Parameters:make (callable) – type constructor.
Returns:deserializer (peek routine)
Return type:callable
rwa.generic.peek_set(s, c, _stack=None)
rwa.generic.peek_tuple(s, c, _stack=None)
rwa.generic.peek_with_kwargs(init, args=[], permissive=False)

Make datatypes passing keyworded arguments to the constructor.

This is a factory function; returns the actual peek routine.

Parameters:
  • init (callable) – type constructor.
  • args (iterable) – arguments NOT to be keyworded; order does matter.
  • permissive (bool) – missing positional arguments are set to None (new in 0.8.5).
Returns:

deserializer (peek routine).

Return type:

callable

All the peeked attributes that are not referenced in args are passed to init as keyworded arguments.

rwa.generic.poke(exposes)

Default serializer factory.

Parameters:exposes (iterable) – attributes to serialized.
Returns:serializer (poke routine).
Return type:callable
rwa.generic.poke_assoc(store, objname, assoc, container, visited=None, _stack=None)

Serialize association lists.

rwa.generic.poke_dict(v, n, d, c, visited=None, _stack=None)
rwa.generic.poke_native(getstate)

Serializer factory for types which state can be natively serialized.

Parameters:getstate (callable) – takes an object and returns the object’s state to be passed to pokeNative.
Returns:serializer (poke routine).
Return type:callable
rwa.generic.poke_seq(v, n, s, c, visited=None, _stack=None)
rwa.generic.seq_to_assoc(seq)
rwa.generic.unsafe_peek(init)

Deserialize all the attributes available in the container and pass them in the same order as they come in the container.

This is a factory function; returns the actual peek routine.

Parameters:init – type constructor.
Returns:deserializer (peek routine).
Return type:callable

rwa.lazy module

class rwa.lazy.FileStore(storables, resource, mode=None, **kwargs)

Bases: rwa.lazy.LazyStore

close()
poke(*args, **kwargs)

Writes in a container.

Parameters:
  • objname (str) – object name.
  • obj (any) – object to serialize.
  • container (any) – address of the object in the store.
  • visited (dict) – already seriablized objects.
  • _stack (CallStack) – stack of parent object names.
resource
sane
temporary
writes(mode)
class rwa.lazy.LazyPeek(store, storable, container, _stack=None, **kwargs)

Bases: object

deep()
kwargs
locator
peek(deep=False, block=True)
permissive(true=True)
shallow()
storable
store
type
value
class rwa.lazy.LazyStore(storables, verbose=False, **kwargs)

Bases: rwa.generic.GenericStore

close()
container(record_id)
handle
lazy
locator(record)
lock(block=True)
open()
open_args
open_kwargs
peek(objname, container, lazy=None, **kwargs)

Reads from a container.

Parameters:
  • objname (str) – object name.
  • container (any) – address of the object in the store.
  • _stack (CallStack) – stack of parent object names.
Returns:

deserialized object.

Return type:

any

peekStorable(storable, record, *args, **kwargs)
Parameters:
  • storable (StorableHandler) – storable instance.
  • record (any) – record.
  • _stack (CallStack) – stack of parent object names.
Returns:

deserialized object.

Return type:

any

Trailing keyword arguments are passed to the Storable instance’s peek.

poke(objname, obj, record, *args, **kwargs)

Writes in a container.

Parameters:
  • objname (str) – object name.
  • obj (any) – object to serialize.
  • container (any) – address of the object in the store.
  • visited (dict) – already seriablized objects.
  • _stack (CallStack) – stack of parent object names.
release()
class rwa.lazy.PermissivePeek(store, storable, container, _stack=None, **kwargs)

Bases: rwa.lazy.LazyPeek

permissive(true=True)
value
rwa.lazy.islazy(_object)
rwa.lazy.lazytype(_object)
rwa.lazy.lazyvalue(_object, deep=False)
rwa.lazy.peek_assoc(s, c, *args, **kwargs)

rwa.sequence module

Storable strategies for contiguous and optionally homogeneous arrays.

class rwa.sequence.SequenceHandling

Bases: object

base_handlers()
from_record_name(name, typestr=None)
iter_records(store, container)

abstract method

new_container(store, name, obj, container)
peek_array(store, elemtype, container, _stack)

abstract method

peek_dict(factory, exposes=(), **kwargs)
peek_dict_items(store, container, _stack)
peek_heterogeneous_list(store, container, _stack)
peek_homogeneous_list(store, container, _stack)
peek_list(factory, exposes=(), **kwargs)
peek_list_items(store, container, _stack)
poke_array(store, name, elemtype, elements, container, visited, _stack)

abstract method

poke_dict(exposes=(), keys_as_record_names=None)
poke_dict_items(store, name, _dict, container, visited, _stack, keys_as_record_names=None)
poke_heterogeneous_list(store, name, _list, container, visited, _stack)
poke_homogeneous_list(store, name, _type, _list, container, visited, _stack)
poke_list(exposes=())
poke_list_items(store, name, _list, container, visited, _stack)
suitable_array_element(elem)
suitable_record_name(name)
to_record_name(name)

rwa.hdf5 module

class rwa.hdf5.HDF5Store(resource, mode='auto', verbose=False, **kwargs)

Bases: rwa.lazy.FileStore

Store handler for hdf5 files.

Example:

hdf5 = HDF5Store(my_file, 'w')
hdf5.poke('my_object', any_object)
hdf5.close()

hdf5 = HDF5Store(my_file, 'r')
any_object = hdf5.peek('my_object')
container(name)
formatRecordName(objname)

Convert a record name into a record reference.

abstract method

The term record reference refers to the address of the record in the store as it can be natively understood by the underlying store.

Parameters:objname (str) – record/object name.
Returns:
record reference for use in all peek/poke methods except
the main peek() and poke() methods.
Return type:any

See also strRecord().

getRecord(objname, container)

Record getter.

abstract method

Parameters:
  • objname (any) – record reference.
  • container (any) – parent container.
Returns:

record or container.

Return type:

any

getRecordAttr(attr, record)

Record attribute getter.

abstract method

Parameters:
  • attr (str) – attribute name.
  • record (any) – record.
Returns:

attribute string value.

Return type:

str

isAgnostic(storable_type)
isNativeType(obj)

Tell whether an object can be natively serialized.

If True, poke() delegates to pokeNative(). Otherwise, poke() delegates to tryPokeAny().

The default implementation returns True.

locator(record)
newContainer(objname, obj, container)

Make a new container.

abstract method

Parameters:
  • objname (any) – record reference.
  • obj (any) – object to be serialized into the record; useful only if the type of the record depends on the nature of the object.
  • container (any) – container.
Returns:

reference (address in the store) of the new container.

Return type:

any

peek(objname, record=None, _stack=None, **kwargs)

Reads from a container.

Parameters:
  • objname (str) – object name.
  • container (any) – address of the object in the store.
  • _stack (CallStack) – stack of parent object names.
Returns:

deserialized object.

Return type:

any

peekNative(record)

Let the underlying store deserialize an object.

abstract method

See also pokeNative().

poke(objname, obj, container=None, visited=None, _stack=None, **kwargs)

Writes in a container.

Parameters:
  • objname (str) – object name.
  • obj (any) – object to serialize.
  • container (any) – address of the object in the store.
  • visited (dict) – already seriablized objects.
  • _stack (CallStack) – stack of parent object names.
pokeNative(objname, obj, container)

Let the underlying store serialize an object.

abstract method

Parameters:
  • objname (any) – record reference.
  • obj (any) – object to be serialized.
  • container (any) – container or record.

For stores with dict-like interface, pokeNative() can be thought as:

container[objname] = obj

See also peekNative().

pokeVisited(objname, obj, container, existing, *args, **kwargs)

Serialize an already serialized object.

If the underlying store supports linking, this is the place where to make links.

The default implementation delegates to pokeStorable() or pokeNative().

Parameters:
  • objname (any) – record reference.
  • obj (any) – object to be serialized.
  • existing (any) – absolute reference of the record which the object was already serialized into.
  • visited (dict) – already serialized objects.
  • _stack (CallStack) – stack of parent object names.
setRecordAttr(attr, val, record)

Record attribute setter.

abstract method

Parameters:
  • attr (str) – attribute name.
  • val (str) – attribute string value.
  • record (any) – record.
store
tryPokeAny(objname, obj, record, visited=None, _stack=None, **kwargs)

First try to poke with pokeNative(). If this fails, generate a default storable instance and try with pokeStorable() instead.

abstract method

See also pokeStorable() for a description of the input arguments.

See also isNativeType() for how to route an object through tryPokeAny().

writes(mode)
class rwa.hdf5.PandasStorable(python_type, key=None, handlers=[])

Bases: rwa.storable.Storable

default_version

Default version (tuple) or None. Read-only property to be overloaded.

If returns None, the latest version/handler will be selected.

Example implementations:

class MyStorable(Storable):
    @property
    def default_version(self):
        if self.params.get('my_module.my_boolean_option', None):
            return (2,) # default version is number 2

class MyStorable(Storable):
    @property
    def default_version(self):
        if sys.version_info[0] == 2: # if Python 2
            # return earliest version instead of latest
            return min([ h.version for h in self.handlers ])
class rwa.hdf5.SequenceV2

Bases: rwa.sequence.SequenceHandling

from_record_name(name, typestr=None)
iter_records(store, container)

abstract method

peek_array(store, elemtype, container, _stack)

abstract method

poke_array(store, name, elemtype, elements, container, visited, _stack)

abstract method

suitable_array_element(elem)
suitable_record_name(name)
to_record_name(name)
rwa.hdf5.binary_peek(service, container, *args, **kargs)
rwa.hdf5.copy_hdf(from_table, to_table, name)
rwa.hdf5.from_attr(b)
rwa.hdf5.from_bytes(b)
rwa.hdf5.from_unicode(s)
rwa.hdf5.hdf5_not_storable(_type, *args, **kwargs)

Tags a type as not serializable.

rwa.hdf5.hdf5_storable(type_or_storable, *args, **kwargs)

Registers a Storable instance in the global service.

rwa.hdf5.mk_native_peek(f)
rwa.hdf5.mk_vlen_poke(f)
rwa.hdf5.native_peek(service, container, *args, **kargs)
rwa.hdf5.native_poke(service, objname, obj, container, *args, **kargs)
rwa.hdf5.peek_Pandas(service, from_table, *args, **kargs)
rwa.hdf5.poke_Pandas(service, objname, obj, to_table, *args, **kargs)
rwa.hdf5.string_poke(service, objname, obj, container, *args, **kargs)
rwa.hdf5.text_peek(service, container, *args, **kargs)
rwa.hdf5.to_binary(s)
rwa.hdf5.to_str(s)
rwa.hdf5.vlen_poke(service, objname, obj, container, *args, **kargs)

rwa.scipy module

class rwa.scipy.ScipySpatialStorable(python_type, key=None, handlers=[])

Bases: rwa.scipy.ScipyStorable

default_version

Default version (tuple) or None. Read-only property to be overloaded.

If returns None, the latest version/handler will be selected.

Example implementations:

class MyStorable(Storable):
    @property
    def default_version(self):
        if self.params.get('my_module.my_boolean_option', None):
            return (2,) # default version is number 2

class MyStorable(Storable):
    @property
    def default_version(self):
        if sys.version_info[0] == 2: # if Python 2
            # return earliest version instead of latest
            return min([ h.version for h in self.handlers ])
class rwa.scipy.ScipyStorable(python_type, key=None, handlers=[])

Bases: rwa.storable.Storable

rwa.scipy.dok_peek(*args, **kwargs)
rwa.scipy.dok_poke(service, matname, mat, *args, **kwargs)
rwa.scipy.dok_recommend(*args, **kwargs)
rwa.scipy.lil_peek(*args, **kwargs)
rwa.scipy.lil_poke(service, matname, mat, *args, **kwargs)
rwa.scipy.lil_recommend(*args, **kwargs)
rwa.scipy.mk_bsr(shape, data, indices, indptr)
rwa.scipy.mk_coo(shape, data, row, col)
rwa.scipy.mk_csc(shape, data, indices, indptr)
rwa.scipy.mk_csr(shape, data, indices, indptr)
rwa.scipy.mk_dia(shape, data, offsets)
rwa.scipy.scipy_spatial_storable(name, exposes, v1_exposes, check)

rwa.pandas module

exception rwa.pandas.DebugWarning

Bases: RuntimeWarning

exception rwa.pandas.Python35Warning

Bases: DeprecationWarning

rwa.pandas.peek_categorical(*args, **kwargs)
rwa.pandas.peek_categoricaldtype(*args, **kwargs)
rwa.pandas.peek_categoricalindex(*args, **kwargs)
rwa.pandas.peek_dataframe(service, container, _stack=None, force_unicode=None)
rwa.pandas.peek_index(service, container, _stack=None, force_unicode=None)
rwa.pandas.peek_multiindex(service, container, _stack=None, force_unicode=None)
rwa.pandas.peek_numerical_index(init=<class 'pandas.core.indexes.base.Index'>, func=None)

Peek factory for Pandas numerical indices.

rwa.pandas.peek_rangeindex(*args, **kwargs)
rwa.pandas.peek_uint64index(*args, **kwargs)
rwa.pandas.poke_dataframe(service, dfname, df, parent_container, *args, **kwargs)
rwa.pandas.poke_index(service, ixname, ix, parent_container, visited=None, _stack=None)
rwa.pandas.poke_multiindex(service, ixname, ix, parent_container, *args, **kwargs)

Poke procedure for pandas.MultiIndex.

Converts all the pandas.core.base.FrozenList into tuples.

rwa.pandas.poke_series(service, sname, s, parent_container, *args, **kwargs)
rwa.pandas.unicode_categories(peek, attrs=None)

Helper for converting the categories attribute (and others) of categorical datatypes into unicode.

rwa.pandas.unicode_index(peek, attrs=None)

Helper for converting the name attribute (and others) of indices into unicode.