Reference


Schema

class zlmdb.Schema[source]

ZLMDB database schema definition.

SLOT_DATA_EMPTY = 0

Database slot is empty (unused, not necessarily zero’ed, but uninitialized).

SLOT_DATA_METADATA = 1

FIXME.

SLOT_DATA_TYPE = 2

FIXME.

SLOT_DATA_SEQUENCE = 3

FIXME.

SLOT_DATA_TABLE = 4

Database slot contains a persistent map, for example a map of type OID to Pickle.

SLOT_DATA_INDEX = 5

FIXME.

SLOT_DATA_REPLICATION = 6

FIXME.

SLOT_DATA_MATERIALIZATION = 7

FIXME.

slot(slot_index, marshal=None, unmarshal=None, build=None, cast=None, compress=False)[source]

Decorator for use on classes derived from zlmdb.PersistentMap. The decorator define slots in a LMDB database schema based on persistent maps, and slot configuration.

Parameters:
  • slot_index

  • marshal

  • unmarshal

  • build

  • cast

  • compress

Returns:

Database

class zlmdb.Database(dbpath: str | None = None, maxsize: int = 10485760, readonly: bool = False, lock: bool = True, sync: bool = True, create: bool = True, open_now: bool = True, writemap: bool = False, context: Any | None = None, log: ILogger | None = None)[source]

ZLMDB database access.

Objects of this class are generally “light-weight” (cheap to create and destroy), but do manage internal resource such as file descriptors.

To manage these resources in a robust way, this class implements the Python context manager interface.

Parameters:
  • dbpath – LMDB database path: a directory with (at least) 2 files, a data.mdb and a lock.mdb. If no database exists at the given path, create a new one.

  • maxsize – Database size limit in bytes, with a default of 1MB.

  • readonly – Open database read-only. When True, deny any modifying database operations. Note that the LMDB lock file (lock.mdb) still needs to be written (by readers also), and hence at the filesystem level, a LMDB database directory must be writable.

  • sync – Open database with sync on commit.

  • create – Automatically create database if it does not yet exist.

  • open_now – Open the database immediately (within this constructor).

  • writemap – Use direct write to mmap’ed database rather than regular file IO writes. Be careful when using any storage other than locally attached filesystem/drive.

  • context – Optional context within which this database instance is created.

  • log – Log object to use for logging from this class.

property context
Returns:

property dbpath: str | None
Returns:

property maxsize: int
Returns:

property is_sync: bool
Returns:

property is_readonly: bool
Returns:

property is_writemap: bool
Returns:

property is_open: bool
Returns:

static scratch(dbpath: str)[source]
Parameters:

dbpath

Returns:

begin(write: bool = False, buffers: bool = False, stats: TransactionStats | None = None) Transaction[source]
Parameters:
  • write

  • buffers

  • stats

Returns:

sync(force: bool = False)[source]
Parameters:

force

Returns:

config() Dict[str, Any][source]
Returns:

stats(include_slots: bool = False) Dict[str, Any][source]
Parameters:

include_slots

Returns:

attach_table(klass: Type[PersistentMap])[source]
Parameters:

klass

Returns:

Transaction


class zlmdb.Transaction(db, write=False, buffers=False, stats=None)[source]

Transactions in zLMDB are always run under an instance of this class.

Parameters:
id()[source]
Returns:

get(key)[source]
Parameters:

key

Returns:

put(key, data, overwrite=True)[source]
Parameters:
  • key

  • data

  • overwrite

Returns:

delete(key)[source]
Parameters:

key

Returns:

class zlmdb.TransactionStats[source]

Value class for holding transaction statistics.

property started
Returns:

start time in ns since epoch

property duration
Returns:

duration in ns

reset()[source]
Returns:

PersistentMap


class zlmdb._pmap.PersistentMap(slot: int | None, compress: int | None = None)[source]

Abstract base class for persistent maps stored in LMDB.

Parameters:
  • slot

  • compress

indexes() List[str][source]
Returns:

is_index() bool[source]

Flag indicating whether this pmap is used as an index.

Returns:

attach_index(name: str, pmap: PersistentMap, fkey: Callable, nullable: bool = False, unique: bool = True)[source]
Parameters:
  • name

  • pmap

  • fkey

  • nullable

  • unique

detach_index(name: str)[source]
Parameters:

name

select(txn: Transaction, from_key: Any | None = None, to_key: Any | None = None, return_keys: bool = True, return_values: bool = True, reverse: bool = False, limit: int | None = None) PersistentMapIterator[source]

Select all records (key-value pairs) in table, optionally within a given key range.

Parameters:
  • txn – The transaction in which to run.

  • from_key – Return records starting from (and including) this key.

  • to_key – Return records up to (but not including) this key.

  • return_keys – If True (default), return keys of records.

  • return_values – If True (default), return values of records.

  • reverse – If True, return records in reverse order.

  • limit – Limit number of records returned.

Returns:

count(txn: Transaction, prefix: Any | None = None) int[source]

Count number of records in the persistent map. When no prefix is given, the total number of records is returned. When a prefix is given, only the number of records with keys that have this prefix are counted.

Parameters:
  • txn – The transaction in which to run.

  • prefix – The key prefix of records to count.

Returns:

The number of records.

count_range(txn: Transaction, from_key: Any, to_key: Any) int[source]

Counter number of records in the perstistent map with keys within the given range.

Parameters:
  • txn – The transaction in which to run.

  • from_key – Count records starting and including from this key.

  • to_key – End counting records before this key.

Returns:

The number of records.

truncate(txn: Transaction, rebuild_indexes: bool = True) int[source]
Parameters:
  • txn

  • rebuild_indexes

Returns:

rebuild_indexes(txn: Transaction) Tuple[int, int][source]
Parameters:

txn

Returns:

rebuild_index(txn: Transaction, name: str) Tuple[int, int][source]
Parameters:
  • txn

  • name

Returns:

class zlmdb._pmap.PersistentMapIterator(txn: Transaction, pmap: PersistentMap, from_key: Any | None = None, to_key: Any | None = None, return_keys: bool = True, return_values: bool = True, reverse: bool = False, limit: int | None = None)[source]

Iterator that walks over zLMDB database records.

Parameters:
  • txn

  • pmap

  • from_key

  • to_key

  • return_keys

  • return_values

  • reverse

  • limit

next()
Returns:

Return either (key, value), key or value, depending on return_keys and return_values.

Typed PersistentMap


class zlmdb.MapBytes16FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes16KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with Bytes16 keys and Flatbuffers values.

class zlmdb.MapBytes16TimestampUuid(slot=None, compress=None)[source]

Bases: _Bytes16TimestampKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (Bytes20, Timestamp) keys and UUID values.

class zlmdb.MapBytes16TimestampUuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes16TimestampUuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Bytes20, Timestamp, UUID) keys and Flatbuffers values.

class zlmdb.MapBytes20Bytes16(slot=None, compress=None)[source]

Bases: _Bytes20KeysMixin, _Bytes16ValuesMixin, PersistentMap

Persistent map with Bytes20 keys and Bytes16 values.

class zlmdb.MapBytes20Bytes20(slot=None, compress=None)[source]

Bases: _Bytes20KeysMixin, _Bytes20ValuesMixin, PersistentMap

Persistent map with Bytes20 keys and Bytes20 values.

class zlmdb.MapBytes20Bytes20FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes20Bytes20KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Bytes20, Bytes20) keys and Flatbuffers values.

class zlmdb.MapBytes20Bytes20Timestamp(slot=None, compress=None)[source]

Bases: _Bytes20KeysMixin, _Bytes20TimestampValuesMixin, PersistentMap

Persistent map with Bytes20 keys and (Bytes20, Timestamp) values.

class zlmdb.MapBytes20FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes20KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with Bytes20 keys and Flatbuffers values.

class zlmdb.MapBytes20StringFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes20StringKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Bytes20, String) keys and Flatbuffers values.

class zlmdb.MapBytes20TimestampBytes20(slot=None, compress=None)[source]

Bases: _Bytes20TimestampKeysMixin, _Bytes20ValuesMixin, PersistentMap

Persistent map with (Bytes20, Timestamp) keys and Bytes20 values.

class zlmdb.MapBytes20TimestampUuid(slot=None, compress=None)[source]

Bases: _Bytes20TimestampKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (Bytes20, Timestamp) keys and UUID values.

class zlmdb.MapBytes20Uuid(slot=None, compress=None)[source]

Bases: _Bytes20KeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with Bytes20 keys and UUID values.

class zlmdb.MapBytes32Bytes32(slot=None, compress=None)[source]

Bases: _Bytes32KeysMixin, _Bytes32ValuesMixin, PersistentMap

Persistent map with Bytes32 keys and Bytes32 values.

class zlmdb.MapBytes32Bytes32FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes32Bytes32KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Bytes32, Bytes32) keys and Flatbuffers values.

class zlmdb.MapBytes32FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes32KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with Bytes32 keys and Flatbuffers values.

class zlmdb.MapBytes32StringFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes32StringKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Bytes32, String) keys and Flatbuffers values.

class zlmdb.MapBytes32Timestamp(slot=None, compress=None)[source]

Bases: _Bytes32KeysMixin, _TimestampValuesMixin, PersistentMap

Persistent map with Bytes32 keys and Timestamp values.

class zlmdb.MapBytes32Uuid(slot=None, compress=None)[source]

Bases: _Bytes32KeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with Bytes32 keys and UUID values.

class zlmdb.MapBytes32UuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Bytes32UuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Bytes32, UUID) keys and Flatbuffers values.

class zlmdb.MapOid3FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Oid3KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (OID, OID, OID) / (uint64, uint64, uint64) keys and FlatBuffers values.

class zlmdb.MapOidCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _OidKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and CBOR values.

class zlmdb.MapOidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _OidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and FlatBuffers values.

class zlmdb.MapOidJson(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _OidKeysMixin, _JsonValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and JSON values.

class zlmdb.MapOidOid(slot=None, compress=None)[source]

Bases: _OidKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and OID (uint64) values.

class zlmdb.MapOidOidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _OidOidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (OID, OID) / (uint64, uint64) keys and FlatBuffers values.

class zlmdb.MapOidOidOid(slot=None, compress=None)[source]

Bases: _OidOidKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with (OID, OID) keys and OID values.

class zlmdb.MapOidOidSet(slot=None, compress=None)[source]

Bases: _OidKeysMixin, _OidSetValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and OID-set (set of unique uint64) values.

class zlmdb.MapOidPickle(slot=None, compress=None)[source]

Bases: _OidKeysMixin, _PickleValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and Python pickle values.

class zlmdb.MapOidString(slot=None, compress=None)[source]

Bases: _OidKeysMixin, _StringValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and string (utf8) values.

class zlmdb.MapOidStringOid(slot=None, compress=None)[source]

Bases: _OidStringKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with (OID, string) keys and OID values.

class zlmdb.MapOidTimestampFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _OidTimestampKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (OID, Timestamp) keys and Flatbuffers values, where Timestamp is a np.datetime64[ns].

class zlmdb.MapOidTimestampOid(slot=None, compress=None)[source]

Bases: _OidTimestampKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with (OID, Timestamp) keys and OID values, where Timestamp is a np.datetime64[ns].

class zlmdb.MapOidTimestampStringOid(slot=None, compress=None)[source]

Bases: _OidTimestampStringKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with (OID, Timestamp, String) keys and OID values, where Timestamp is a np.datetime64[ns].

class zlmdb.MapOidUuid(slot=None, compress=None)[source]

Bases: _OidKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with OID (uint64) keys and UUID (16 bytes) values.

class zlmdb.MapSlotUuidUuid(slot=None, compress=None)[source]

Bases: _SlotUuidKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (slot, UUID) and UUID values.

class zlmdb.MapStringCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _StringKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with string (utf8) keys and CBOR values.

class zlmdb.MapStringFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _StringKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with string (utf8) keys and FlatBuffers values.

class zlmdb.MapStringJson(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _StringKeysMixin, _JsonValuesMixin, PersistentMap

Persistent map with string (utf8) keys and JSON values.

class zlmdb.MapStringOid(slot=None, compress=None)[source]

Bases: _StringKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with string (utf8) keys and OID (uint64) values.

class zlmdb.MapStringOidOid(slot=None, compress=None)[source]

Bases: _StringOidKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with (string:utf8, OID:uint64) keys and OID:uint64 values.

class zlmdb.MapStringPickle(slot=None, compress=None)[source]

Bases: _StringKeysMixin, _PickleValuesMixin, PersistentMap

Persistent map with string (utf8) keys and Python pickle values.

class zlmdb.MapStringString(slot=None, compress=None)[source]

Bases: _StringKeysMixin, _StringValuesMixin, PersistentMap

Persistent map with string (utf8) keys and string (utf8) values.

class zlmdb.MapStringStringStringUuid(slot=None, compress=None)[source]

Bases: _StringStringStringKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (string, string, string) keys and UUID (16 bytes) values.

class zlmdb.MapStringStringUuid(slot=None, compress=None)[source]

Bases: _StringStringKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (string, string) keys and UUID (16 bytes) values.

class zlmdb.MapStringTimestampCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _StringTimestampKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with (String, Timestamp) keys and CBOR values.

class zlmdb.MapStringUuid(slot=None, compress=None)[source]

Bases: _StringKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with string (utf8) keys and UUID (16 bytes) values.

class zlmdb.MapTimestampBytes32FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _TimestampBytes32KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Timestamp, Bytes32) keys and FlatBuffers values.

class zlmdb.MapTimestampFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _TimestampKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with Timestamp keys and FlatBuffers values.

class zlmdb.MapTimestampStringCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _TimestampStringKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with (Timestamp, String) keys and CBOR values.

class zlmdb.MapTimestampStringFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _TimestampStringKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Timestamp, String) keys and FlatBuffers values.

class zlmdb.MapTimestampUuidCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _TimestampUuidKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with (Timestamp, UUID) keys and CBOR values.

class zlmdb.MapTimestampUuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _TimestampUuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Timestamp, UUID) keys and FlatBuffers values.

class zlmdb.MapTimestampUuidStringFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _TimestampUuidStringKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (Timestamp, UUID, String) keys and FlatBuffers values.

class zlmdb.MapUint16UuidTimestampFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _Uint16UuidTimestampKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (uint16, UUID, Timestamp) keys and FlatBuffers values.

class zlmdb.MapUuidBytes20Bytes20Uint8UuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidBytes20Bytes20Uint8UuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, bytes[20], bytes[20], uint8, UUID) keys and FlatBuffers values.

class zlmdb.MapUuidBytes20Uint8FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidBytes20Uint8KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, bytes[20], uint8) keys and FlatBuffers values.

class zlmdb.MapUuidBytes20Uint8UuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidBytes20Uint8UuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, bytes[20], uint8, UUID) keys and FlatBuffers values.

class zlmdb.MapUuidBytes32FlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidBytes32KeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, Bytes32) keys and Flatbuffers values.

class zlmdb.MapUuidCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _UuidKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with UUID (16 bytes) keys and CBOR values.

class zlmdb.MapUuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with UUID (16 bytes) keys and FlatBuffers values.

class zlmdb.MapUuidJson(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _UuidKeysMixin, _JsonValuesMixin, PersistentMap

Persistent map with UUID (16 bytes) keys and JSON values.

class zlmdb.MapUuidOid(slot=None, compress=None)[source]

Bases: _UuidKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with UUID (16 bytes) keys and OID (uint64) values.

class zlmdb.MapUuidPickle(slot=None, compress=None)[source]

Bases: _UuidKeysMixin, _PickleValuesMixin, PersistentMap

Persistent map with UUID (16 bytes) keys and Python Pickle values.

class zlmdb.MapUuidString(slot=None, compress=None)[source]

Bases: _UuidKeysMixin, _StringValuesMixin, PersistentMap

Persistent map with UUID (16 bytes) keys and string (utf8) values.

class zlmdb.MapUuidStringFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidStringKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, String) keys and Flatbuffers values.

class zlmdb.MapUuidStringOid(slot=None, compress=None)[source]

Bases: _UuidStringKeysMixin, _OidValuesMixin, PersistentMap

Persistent map with (UUID, string) keys and Oid values.

class zlmdb.MapUuidStringUuid(slot=None, compress=None)[source]

Bases: _UuidStringKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (UUID, string) keys and UUID values.

class zlmdb.MapUuidTimestampBytes32(slot=None, compress=None)[source]

Bases: _UuidTimestampKeysMixin, _Bytes32ValuesMixin, PersistentMap

Persistent map with (UUID, Timestamp) keys and Bytes32 values.

class zlmdb.MapUuidTimestampCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _UuidTimestampKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with (UUID, Timestamp) keys and CBOR values.

class zlmdb.MapUuidTimestampFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidTimestampKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, Timestamp) keys and FlatBuffers values.

class zlmdb.MapUuidTimestampUuid(slot=None, compress=None)[source]

Bases: _UuidTimestampKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (UUID, timestamp) keys and UUID values.

class zlmdb.MapUuidTimestampUuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidTimestampUuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, Timestamp, UUID) keys and FlatBuffers values.

class zlmdb.MapUuidUuid(slot=None, compress=None)[source]

Bases: _UuidKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with UUID (16 bytes) keys and UUID (16 bytes) values.

class zlmdb.MapUuidUuidCbor(slot=None, compress=None, marshal=None, unmarshal=None)[source]

Bases: _UuidUuidKeysMixin, _CborValuesMixin, PersistentMap

Persistent map with (UUID, UUID) keys and CBOR values.

class zlmdb.MapUuidUuidFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidUuidKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, UUID) keys and Flatbuffers values.

class zlmdb.MapUuidUuidSet(slot=None, compress=None)[source]

Bases: _UuidKeysMixin, _UuidSetValuesMixin, PersistentMap

Persistent map with (UUID, string) keys and UUID values.

class zlmdb.MapUuidUuidStringFlatBuffers(slot=None, compress=None, build=None, cast=None)[source]

Bases: _UuidUuidStringKeysMixin, _FlatBuffersValuesMixin, PersistentMap

Persistent map with (UUID, UUID, String) keys and Flatbuffers values.

class zlmdb.MapUuidUuidStringUuid(slot=None, compress=None)[source]

Bases: _UuidUuidStringKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (UUID, UUID, string) keys and UUID values.

class zlmdb.MapUuidUuidUuid(slot=None, compress=None)[source]

Bases: _UuidUuidKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (UUID, UUID) keys and UUID values.

class zlmdb.MapUuidUuidUuidStringUuid(slot=None, compress=None)[source]

Bases: _UuidUuidUuidStringKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (UUID, UUID, UUID, string) keys and UUID values.

class zlmdb.MapUuidUuidUuidUuid(slot=None, compress=None)[source]

Bases: _UuidUuidUuidKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (UUID, UUID, UUID) keys and UUID values.

class zlmdb.MapUuidUuidUuidUuidUuid(slot=None, compress=None)[source]

Bases: _UuidUuidUuidUuidKeysMixin, _UuidValuesMixin, PersistentMap

Persistent map with (UUID, UUID, UUID, UUID) keys and UUID values.

Key Types


class zlmdb._types._Bytes16KeysMixin[source]
class zlmdb._types._Bytes16TimestampKeysMixin[source]
class zlmdb._types._Bytes16TimestampUuidKeysMixin[source]
class zlmdb._types._Bytes20Bytes20KeysMixin[source]
class zlmdb._types._Bytes20KeysMixin[source]
class zlmdb._types._Bytes20StringKeysMixin[source]
class zlmdb._types._Bytes20TimestampKeysMixin[source]
class zlmdb._types._Bytes32Bytes32KeysMixin[source]
class zlmdb._types._Bytes32KeysMixin[source]
class zlmdb._types._Bytes32StringKeysMixin[source]
class zlmdb._types._Bytes32UuidKeysMixin[source]
class zlmdb._types._Oid3KeysMixin[source]
class zlmdb._types._OidKeysMixin[source]
MAX_OID = 9007199254740992

Valid OID are from the integer range [0, MAX_OID].

The upper bound 2**53 is chosen since it is the maximum integer that can be represented as a IEEE double such that all smaller integers are representable as well.

Hence, IDs can be safely used with languages that use IEEE double as their main (or only) number type (JavaScript, Lua, etc).

class zlmdb._types._OidOidKeysMixin[source]
class zlmdb._types._OidStringKeysMixin[source]
class zlmdb._types._OidTimestampKeysMixin[source]
class zlmdb._types._OidTimestampStringKeysMixin[source]
class zlmdb._types._SlotUuidKeysMixin[source]
class zlmdb._types._StringKeysMixin[source]
class zlmdb._types._StringOidKeysMixin[source]
class zlmdb._types._StringStringKeysMixin[source]
class zlmdb._types._StringStringStringKeysMixin[source]
class zlmdb._types._StringTimestampKeysMixin[source]
class zlmdb._types._TimestampBytes32KeysMixin[source]
class zlmdb._types._TimestampKeysMixin[source]
class zlmdb._types._TimestampStringKeysMixin[source]
class zlmdb._types._TimestampUuidKeysMixin[source]
class zlmdb._types._TimestampUuidStringKeysMixin[source]
class zlmdb._types._Uint16UuidTimestampKeysMixin[source]
class zlmdb._types._UuidBytes20Bytes20Uint8UuidKeysMixin[source]
class zlmdb._types._UuidBytes20Uint8KeysMixin[source]
class zlmdb._types._UuidBytes20Uint8UuidKeysMixin[source]
class zlmdb._types._UuidBytes32KeysMixin[source]
class zlmdb._types._UuidKeysMixin[source]
class zlmdb._types._UuidStringKeysMixin[source]
class zlmdb._types._UuidTimestampKeysMixin[source]
class zlmdb._types._UuidTimestampUuidKeysMixin[source]
class zlmdb._types._UuidUuidKeysMixin[source]
class zlmdb._types._UuidUuidStringKeysMixin[source]
class zlmdb._types._UuidUuidUuidKeysMixin[source]
class zlmdb._types._UuidUuidUuidStringKeysMixin[source]
class zlmdb._types._UuidUuidUuidUuidKeysMixin[source]

Value Types


class zlmdb._types._Bytes16ValuesMixin[source]
class zlmdb._types._Bytes20TimestampValuesMixin[source]
class zlmdb._types._Bytes20ValuesMixin[source]
class zlmdb._types._Bytes32ValuesMixin[source]
class zlmdb._types._CborValuesMixin(marshal=None, unmarshal=None)[source]
class zlmdb._types._FlatBuffersValuesMixin(build, cast)[source]
class zlmdb._types._JsonValuesMixin(marshal=None, unmarshal=None)[source]
class zlmdb._types._OidSetValuesMixin[source]
class zlmdb._types._OidValuesMixin[source]
class zlmdb._types._Pickle5ValuesMixin[source]

Arbitrary Python object values, serialized using Pickle protocol version 5. Protocol version 5 was added in Python 3.8. It adds support for out-of-band data and speedup for in-band data.

class zlmdb._types._PickleValuesMixin[source]
class zlmdb._types._StringSetValuesMixin[source]
class zlmdb._types._StringValuesMixin[source]
class zlmdb._types._TimestampValuesMixin[source]
class zlmdb._types._UuidSetValuesMixin[source]
class zlmdb._types._UuidValuesMixin[source]