class craftutils.wrap.dragons.Table.TableColumns(collections.OrderedDict)

OrderedDict subclass for a set of columns.

This class enhances item access to provide convenient access to columns by name or index, including slice access. It also handles renaming of columns.

The initialization argument cols can be a list of Column objects or any structure that is valid for initializing a Python dict. This includes a dict, list of (key, val) tuples or [key, val] lists, etc.

Parameters

colsdict, list, tuple; optional

Column objects as data structure that can init dict (see above)

Public members

TableColumns(cols={})

Initialize self. See help(type(self)) for accurate signature.

__getitem__(item)

Get items from a TableColumns object.

__setitem__(item, value, validated=False)

Set item in this dict instance, but do not allow directly replacing an existing column unless it is already validated (and thus is certain to not corrupt the table).

__repr__()

Return repr(self).

__delitem__(name)

Delete self[key].

isinstance(cls)

Return a list of columns which are instances of the specified classes.

not_isinstance(cls)

Return a list of columns which are not instances of the specified classes.

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.

__iter__()

Implement iter(self).

fromkeys(value=None)

Create a new ordered dictionary with keys from iterable and values set to value.

__reduce__()

Return state information for pickling

setdefault(key, default=None)

Insert key with a value of default if key is not in the dictionary.

pop(k[, d]) v, remove specified key and return the corresponding

value. If key is not found, d is returned if given, otherwise KeyError is raised.

popitem(last=True)

Remove and return a (key, value) pair from the dictionary.

keys() a set-like object providing a view on D's keys
values() an object providing a view on D's values
items() a set-like object providing a view on D's items
update([E, ]**F) None.  Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

clear() None.  Remove all items from od.
copy() a shallow copy of od
move_to_end(key, last=True)

Move an existing element to the end (or beginning if last is false).