Queries and joins return their results as new Table objects, so that
queries and joins can be easily performed as a succession of
operations.
|
|
|
__len__(self)
Return the number of objects in the Table. |
source code
|
|
|
__iter__(self)
Create an iterator over the objects in the Table. |
source code
|
|
|
__getitem__(self,
i)
Provides direct indexed/sliced access to the Table's underlying list
of objects. |
source code
|
|
|
__getattr__(self,
attr)
(Deprecated) A quick way to query for matching records using their
indexed attributes. |
source code
|
|
|
|
|
|
|
__add__(self,
other)
Support UNION of 2 tables using "+" operator. |
source code
|
|
|
__iadd__(self,
other)
Support UNION of 2 tables using "+=" operator. |
source code
|
|
|
|
|
__call__(self,
table_name=None)
A simple way to assign a name to a table, such as those dynamically
created by joins and queries. |
source code
|
|
|
copy_template(self,
name=None)
Create empty copy of the current table, with copies of all index
definitions. |
source code
|
|
|
clone(self,
name=None)
Create full copy of the current table, including table contents and
index definitions. |
source code
|
|
|
|
|
|
|
|
|
insert_many(self,
it)
Inserts a collection of objects into the table. |
source code
|
|
|
|
|
remove_many(self,
it)
Removes a collection of objects from the table. |
source code
|
|
|
where(self,
wherefn=None,
**kwargs)
Retrieves matching objects from the table, based on given named
parameters. |
source code
|
|
|
delete(self,
**kwargs)
Deletes matching objects from the table, based on given named
parameters. |
source code
|
|
|
sort(self,
key,
reverse=False)
Sort Table in place, using given fields as sort key. |
source code
|
|
|
select(self,
fields,
**exprs)
Create a new table containing a subset of attributes, with optionally
newly-added fields computed from each rec in the original table. |
source code
|
|
|
format(self,
*fields,
**exprs)
Create a new table with all string formatted attribute values,
typically in preparation for formatted output. |
source code
|
|
|
join(self,
other,
attrlist=None,
auto_create_indexes=True,
**kwargs)
Join the objects of one table with the objects of another, based on
the given matching attributes in the named arguments. |
source code
|
|
|
join_on(self,
attr)
Creates a JoinTerm in preparation for joining with another table, to
indicate what attribute should be used in the join. |
source code
|
|
|
|
|
csv_import(self,
csv_source,
encoding=' UTF-8 ' ,
transforms=None,
**kwargs)
Imports the contents of a CSV-formatted file into this table. |
source code
|
|
|
tsv_import(self,
xsv_source,
transforms=None)
Imports the contents of a tab-separated data file into this table. |
source code
|
|
|
csv_export(self,
csv_dest,
fieldnames=None,
encoding=' UTF-8 ' )
Exports the contents of the table to a CSV-formatted file. |
source code
|
|
|
json_import(self,
source,
encoding=' UTF-8 ' ,
transforms=None)
Imports the contents of a JSON data file into this table. |
source code
|
|
|
json_export(self,
dest,
fieldnames=None,
encoding=' UTF-8 ' )
Exports the contents of the table to a JSON-formatted file. |
source code
|
|
|
add_field(self,
attrname,
fn,
default=None)
Computes a new attribute for each object in table, or replaces an
existing attribute in each record with a computed value |
source code
|
|
|
addfield(self,
attrname,
fn,
default=None)
(Deprecated) Legacy method to add a field to all objects in table; to
be replaced by add_field. |
source code
|
|
|
groupby(self,
keyexpr,
**outexprs)
simple prototype of group by, with support for expressions in the
group-by clause and outputs |
source code
|
|
|
|
|
unique(self,
key=None)
Create a new table of objects,containing no duplicate values. |
source code
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|