| | |
- __builtin__.dict(__builtin__.object)
-
- AlignDict
- CellDict
- TitleDict
- __builtin__.object
-
- Cell
- Table
- items_of
class AlignDict(__builtin__.dict) |
| |
A mapping ``integer --> string``. Keys must be integer, values must be
one of the strings "left", "right", "center", or "point". |
| |
- Method resolution order:
- AlignDict
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __init__(self, mapping_or_iterable=None, **kwargs)
- __setitem__(self, key, value)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __cmp__(...)
- x.__cmp__(y) <==> cmp(x,y)
- __contains__(...)
- D.__contains__(k) -> True if D has a key k, else False
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __sizeof__(...)
- D.__sizeof__() -> size of D in memory, in bytes
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- fromkeys(...)
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.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(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
- values(...)
- D.values() -> list of D's values
- viewitems(...)
- D.viewitems() -> a set-like object providing a view on D's items
- viewkeys(...)
- D.viewkeys() -> a set-like object providing a view on D's keys
- viewvalues(...)
- D.viewvalues() -> an object providing a view on D's values
Data and other attributes inherited from __builtin__.dict:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class CellDict(__builtin__.dict) |
| |
A mapping ``(row index, column index) --> cell object``. |
| |
- Method resolution order:
- CellDict
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __delitem__(self, inds)
- __init__(self, mapping_or_iterable=None, **kwargs)
- __setitem__(self, key, value)
- index(self, cell)
- Return indices (row, column) of the given cell object. Raise
ValueError if the cell is not present.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __cmp__(...)
- x.__cmp__(y) <==> cmp(x,y)
- __contains__(...)
- D.__contains__(k) -> True if D has a key k, else False
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __sizeof__(...)
- D.__sizeof__() -> size of D in memory, in bytes
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- fromkeys(...)
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.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(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
- values(...)
- D.values() -> list of D's values
- viewitems(...)
- D.viewitems() -> a set-like object providing a view on D's items
- viewkeys(...)
- D.viewkeys() -> a set-like object providing a view on D's keys
- viewvalues(...)
- D.viewvalues() -> an object providing a view on D's values
Data and other attributes inherited from __builtin__.dict:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Table(__builtin__.object) |
| | |
Methods defined here:
- __init__(self, cells=None, rowtitles=None, coltitles=None, colalign=None)
- append_column(self, data, title=None, align=None, startrow=0)
- append_row(self, data, title=None, startcol=0)
- bottom(self)
- colinds(self)
- colstrings(self, index, withtitle=False, colalign=None)
- coltitlestrings(self, colalign=None)
- column(self, index)
- colwidth(self, index, withtitle=False, colalign=None)
- colwidth_after_point(self, index)
- colwidth_before_point(self, index)
- colwidths(self, withtitle=False, colalign=None)
- dimensions(self, **kwargs)
- Get table dimensions (the space needed to print the table) in the
form (number of terminal rows, number of terminal columns). All keyword
arguments are passed to :py:meth:`Table.make`.
- insert_cell(self, (row, column), data=None)
- insert_column(self, index, data, title=None, align=None, startrow=0)
- insert_row(self, index, data, title=None, startcol=0)
- left(self)
- make(self, titles=False, hb='', vb='', padding=0, hp=0, vp=0, autoalign=True, rowtitles=False, coltitles=False, hc=' ', vc='', ht=' ', vt='', border='', borderleft='', borderright='', bordertop='', borderbottom='', paddingleft=0, paddingright=0, paddingtop=0, paddingbottom=0, width=None, box=True)
- Create table representation.
The following formatting options exist:
*rowtitles*:
Show row titles. Default: False
*coltitles*:
Show column titles. Default: False
*hc*:
Horizontal cell delimiter. Default: ' '
*vc*:
Vertical cell delimiter. Default: ''
*ht*:
Horizontal delimiter between row titles and data cells.
Default: ' '
*vt*:
Vertical delimiter between column titles and data cells.
Default: ''
*borderleft*:
Character used as the left table border. Default: ''
*borderright*:
Character used as the right table border. Default: ''
*bordertop*:
Character used as the top table border. Default: ''
*borderbottom*:
Character used as the bottom table border. Default: ''
*paddingleft*:
Left cell padding (number of space characters). Default: 0
*paddingright*:
Right cell padding (number of space characters). Default: 0
*paddingtop*:
Top cell padding (number of space characters). Default: 0
*paddingbottom*:
Bottom cell padding (number of space characters). Default: 0
*autoalign*:
If *True*, infer alignment of columns from the column data.
only for those columns for which no alignment has been set.
Default: *True*
*width*:
If not *None*, set the width of the table. The rest of the
characters will be cut from each line. Should be set to the
terminal width for wide tables. Default: *None*
*box*:
If *True*, interpret certain characters in the options *hc*,
*vc*, *ht*, *vt*, *borderleft*, *borderright*, *bordertop*,
*borderbottom*, *hb* and *vb* as unicode box drawing characters
(0x2500..0x2580). May not be available on all systems. See the
section "special delimiters" for a list of characters that are
interpreted. Default: *True*
The following shortcuts exist:
*titles*:
Show row and column titles. Overrides *rowtitles* and
*coltitles*. Default: False
*hb*:
Set horizontal borders. Overrides *bordertop* and
*borderbottom*. Default: ''
*vb*:
Set vertical borders. Overrides *borderleft* and *borderright*.
Default: ''
*padding*:
Set cell padding (number of space characters). Overrides
*paddingtop*, *paddingbottom*, *paddingleft* and
*paddingright*. Default: 0
*hp*:
Set horizontal cell padding (number of space characters).
Overrides *paddingleft* and *paddingright*. Default: 0
*vp*:
Set vertical cell padding (number of space characters).
Overrides *paddingtop* and *paddingbottom*. Default: 0
*border*:
Set borders. Overrides *borderleft*, *borderright*, *bordertop*
and *borderbottom*. Default: ''
Special delimiters:
As long as *box* is *True* (default), certain characters in the options
*hc*, *vc*, *ht*, *vt*, *borderleft*, *borderright*, *bordertop*,
*borderbottom*, *hb* and *vb* are interpreted as unicode box drawing
characters (0x2500..0x2580). May not be available on all systems.
Further information can be found at
http://en.wikipedia.org/wiki/Box-drawing_character
http://unicode.org/charts/PDF/U2500.pdfhttp://unicode.org/charts/PDF
/U2500.pdfhttp://unicode.org/charts/PDF/U2500.pdf
The following characters are interpreted:
"l":
light single line
"h":
heavy single line
"d":
double line
"2":
light double dash
"u":
heavy double dash
"3":
light triple dash
"t":
heavy triple dash
"4":
light quadruple dash
"q":
heavy quadruple dash
- ncols(self)
- nrows(self)
- right(self)
- row(self, index)
- rowinds(self)
- rowinds_and_colinds(self)
- rowtitlescolstrings(self)
- rowtitlescolwidth(self)
- size(self)
- Return size of the table in the form (number of rows, number of
columns), excluding titles.
- top(self)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- cells
- colalign
- coltitles
- rowtitles
Data and other attributes defined here:
- hpiece = u'\u254e'
- vpiece = u'\u2550'
|
class TitleDict(__builtin__.dict) |
| |
A mapping ``integer --> title``. Keys must be integer. |
| |
- Method resolution order:
- TitleDict
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __init__(self, mapping_or_iterable=None, **kwargs)
- __setitem__(self, key, value)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __cmp__(...)
- x.__cmp__(y) <==> cmp(x,y)
- __contains__(...)
- D.__contains__(k) -> True if D has a key k, else False
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __sizeof__(...)
- D.__sizeof__() -> size of D in memory, in bytes
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- fromkeys(...)
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.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(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
- values(...)
- D.values() -> list of D's values
- viewitems(...)
- D.viewitems() -> a set-like object providing a view on D's items
- viewkeys(...)
- D.viewkeys() -> a set-like object providing a view on D's keys
- viewvalues(...)
- D.viewvalues() -> an object providing a view on D's values
Data and other attributes inherited from __builtin__.dict:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class items_of(__builtin__.object) |
| |
Instances of this class are callables which get a certain item of each
element of a given iterable, and returns all items in form of a new
iterable. If item does not exist and a default value is given, return that
value. |
| |
Methods defined here:
- __call__(self, iterable)
- __init__(self, itemname, default=None, dtype=None)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |