| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
Table2array
Primitive parser that converts a simple reST table into ``numpy.recarray``.
The table must be the only table in the text. It must look similar to the
example below (variable parts in angle brackets, optional in double
brackets, everything else must be there, matching is case sensitive, '....'
signifies repetition in kind)::
Table[<NAME>]: <<CAPTION>>
============ =========== ====================== ....
<COLNAME 1> <COLNAME 2> .... ....
============ =========== ====================== ....
<VALUE> <VALUE> <VALUE> <VALUE> ....
....
....
============ =========== ====================== ....
Rows may *not* span multiple lines. The column names must be single words
and legal python names (no spaces, no dots, not starting with a number).
Field values are converted to one of the following python types: *int*,
*float*, or *str*.
If a value is quote with single or double quotation marks then the
outermost quotation marks are stripped and the enclosed value treated as a string.
.. Note:: Values such as 001 must be quoted as '001' or they will be
interpreted as integers (1 in this case).
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
tablename <NAME> of the table |
|||
|
caption <CAPTION> of the table. |
|||
|
records parsed table as records (populate with :meth:`Table2array.parse`) |
|||
|
|||
|
Inherited from |
|||
|
|||
Table2array(string) --> parser
:Arguments:
*string*
string to be parsed
*filename*
read from *filename* instead of string
*autoconvert*
EXPERIMENTAL. ``True``: replace certain values
with special python values (see :class:`convert.Autoconverter`) and possibly
split values into lists (see *sep*).
``False``: leave everything as it is (numbers as numbers and strings
as strings).
*mode*
mode of the :class:`~convert.Autoconverter`
*sep*
If set and *autoconvert* = ``True`` then split field values on the
separator (using :func:`split`) before possible autoconversion.
(NOT WORKING PROPERLY YET)
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Jun 3 22:23:16 2010 | http://epydoc.sourceforge.net |