API Reference
memo (decorator)

@dbzero.memo(singleton: bool = False, prefix: str | None = None, no_default_tags: bool = False)

The @dbzero.memo decorator is the core of dbzero, transforming a standard Python class into a persistent, memory-managed data model. It transparently handles the serialization, storage, and lifecycle of your objects, allowing you to interact with them as if they were regular in-memory instances.

Parameters

  • singleton bool, default False
    When True, the decorated class becomes a singleton within its prefix. The first time you instantiate the class, the object is created and persisted. All subsequent calls to the constructor within the same prefix will return the existing instance, ignoring any new arguments.

  • prefix str, optional
    Specifies a static namespace for the class and all its instances. This is useful for organizing data. If not provided, the class uses the current active prefix set by dbzero.open().

  • no_default_tags bool, default False
    If True, dbzero will not automatically add default system tags (such as the class name) to new instances of this class.

Returns

The decorated Memo class.


Examples

In-depth explanation and examples can be found here