ljson.slapdash package¶
Submodules¶
ljson.slapdash.disk module¶
-
class
ljson.slapdash.disk.
Table
(header, file_, reread_stats=False)[source]¶
ljson.slapdash.generic module¶
Some generic functions and classes for ljson.slapdash.
-
class
ljson.slapdash.generic.
SlapdashHeader
(descriptor)[source]¶ Bases:
object
A Header for ljson slapdash tables. Used to describe the table (as good as possible).
-
class
ljson.slapdash.generic.
SlapdashTable
[source]¶ Bases:
object
A messy table.
SlapdashTable is used to store inhomogenous data, like in a document-oriented database.
-
additem
(document)[source]¶ Add a document to the table.
This will update the header according to the inserted document.
-
calculate_stats
()[source]¶ Calculate statistical information about the data structure. Returns a dict:
{ "length": int, "field_count": dict, "total_datatype_count": dict, "per_field_datatype_count": dict }
-
insert_stats
()[source]¶ Calculate statistical information about the data structure and store the gathered information in the Header.
-
split
(ignore=None)[source]¶ Split the table into tables containing exactly one document type.
Warning: If the table highly inhomogenous, this will produce a high number of tables.
Attribute names listed in
ignore
will be ignored by the split process and the data will not appear in the resulting tables.Warning: Currently not implemented.
-
ljson.slapdash.mem module¶
Module contents¶
ljson.slapdash is basically the messy little brother of ljson.
slapdash is oriented on document-oriented databases. The main difference to ljson is that slapdash rows do not get typechecked and there is no way to ensure homogenity.
However the header might provide some information about the data, for instance, what fields are most common, most unique.