Home | Trees | Indices | Help |
|
---|
|
Read, query and update textual tables via flexible SQL interface.
Tables can be created and populated with data from scratch, built from TSV files, 2D lists or other tables. Once the data is loaded in memory, each storage operation on the table object is delegated via bridge to an SQL storage backend (by default this is SQLite). However the table uses the backend only as a temp storage to ensure maximum portability of the data. Tables can be stored persistently as text (TSV) files and then loaded back in memory when needed.
These Tables can be queried and updated in a vast number of ways; each query returns a new Table:
[rows, columns]
, where rows
can be:
5
(1, 3, 6)
1:3
or :5
or :
and columns
can be:
5
'TmScore'
('ID', 'TmScore')
'ID':'TM'
or
:'TM'
or :
>>> table.where('ID').between(1, 5).select('TmScore', 'RMSD') Table ('TmScore', 'RMSD')
>>> table.where('ID').between(1, 5).update('RMSD', 0.2) Table (the same table)
>>> t.query(r'''SELECT ColumnB * ColumnA AS ComputedValue FROM {0.name} WHERE ColumnC IN ({1}, {1})'''.format(t, Predicate.PH), [12, 55]) iterable
The data contained in a Table can be extracted in several ways:
table[row,
column]
indexing expression or with the dedicated
table.scalar(row, column)
method.
table.dump(file)
.
See Table for full API details.
Classes | |
Between | |
ColumnInfo Holder object for column metadata. |
|
DataRow Represents a table data row. |
|
Equals | |
Expression Metadata container: represents a table select or update expression. |
|
Greater | |
GreaterOrEquals | |
In | |
InvalidColumnError | |
Lower | |
LowerOrEquals | |
NotEquals | |
NotIn | |
Operator | |
Predicate | |
RepositoryImp Abstract SQL backend interface. |
|
SQLiteRepository SQLite-based concrete repository implementor. |
|
Step | |
Table Build and query a TSV Table. |
|
UnsupportedTypeError | |
Where |
Variables | |
__package__ =
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jul 4 20:19:04 2017 | http://epydoc.sourceforge.net |