Flexible immutable entity database
Embedded schema-less database library backed by LMDB.
Currently in development and not stable yet. The interface and disk format may change in future versions without notice. You probably shouldn't use it to store important data.
Permissively licensed with the ISC License.
- provide a language-neutral disk format
- utilize LMDB's properties like transactions, append-only writes, and zero-copy reads
- provide intuitive schema-less entity modeling and querying interface
- store an immutable history of all values in the database
There are a few actions you can perform on entities in a transaction:
An entity is conceptually like a dictionary with attributes and values.
A table is an isolated section of the database for storing entities, usually with a similar set of attributes.
All entities of the same type are stored in one inner LMDB database There is no guarantee that entities have a consistent schema.
Entities are stored on disk as a series of timestamped attribute changes.
- key-value entries have the form
(uuid, timestamp, attribute) -> value
uuidis an auto-generated entity ID
timestampis an auto-generated timestamp of when the entry was appended
valueare the updated entity key value entries
Data is not modified for updates, only appended to indicate the entity changed.
The storage format version is stored as an integer in a special inner database
_metadata, at a key named
_metadata table's keys and values are also encoded with MessagePack.
You can access the storage format version via
This document follows the Keep a Changelog format.
Releases are available on PyPI as
0.2.3 - 2019-09-06
Transaction.deletemethod to permanently remove an entity
0.2.2 - 2019-08-06
- fixed bug where
created_atdates were all from the first entity
0.2.1 - 2019-08-06
- opening a database adds a schema version identifier integer to databases that don't have one
Database.VERSIONfor getting storage format version
queryto add an attribute to entities indicating when they were created
0.2.0 - 2019-07-15
Database.open_tablessince tables are now required when opening a database
Transaction.storefor consistency with
Database.openbehavior to require table names on initialization
Transactionmethods to raise error if a table name is used that was not used to open the database with
0.1.2 - 2019-07-15
Database.create_tablesto create tables in database
Database.open_tablesto open existing tables in database
Database.closeto close database manually
0.1.1 - 2019-07-15
- options for manually closing transactions for when it's not possible to use context managers
0.1.0 - 2019-07-15
- initial schema-less immutable interface over LMDB
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.