Reusable dbzero-backed data model utilities
Project description
dbzero-modelkit
Reusable model primitives for projects that store Python objects with dbzero.
dbzero-modelkit provides small, focused building blocks for common model patterns:
sparse calendars, active-date windows, month-indexed storage, multilingual strings,
FIFO queues, and tag-based object locks. The package is application-neutral and is
intended to be imported by any Python project using dbzero.
Installation
pip install dbzero-modelkit
Requirements:
- Python 3.9 or newer
- One db backend extra:
dbzero-modelkit[dbzero]fordbzero>=0.4.0dbzero-modelkit[dbzero-pro]fordbzero-pro>=0.3.3
Included Models
ActiveBaseandActiveIndexfor objects that are active only within a date or datetime range.Calendar,MonthCalendar,get_month_index, andget_date_from_month_indexfor sparse date-based values.LanguageCodeandML_Stringfor primary text values with optional translations.FiFoQueueandFQ_Itemfor dbzero-backed FIFO queues.MonthStorefor one-object-per-month storage with lazy item creation.ObjectLockfor temporary tag-based locking of dbzero objects.
Quick Start
Initialize dbzero before creating or loading dbzero-backed model objects:
from datetime import date
import dbzero as db0
from dbzero_modelkit import Calendar, FiFoQueue
db0.init("./db0_data", read_write=True)
db0.open("main", "rw")
calendar = Calendar(base_year=2026)
calendar.set(date(2026, 1, 1), "available")
queue = FiFoQueue()
queue.push_back(kind="email", recipient="user@example.test")
assert calendar.get(date(2026, 1, 1)) == "available"
assert queue.pop_front(1) == [
{"kind": "email", "recipient": "user@example.test"},
]
db0.close()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbzero_modelkit-1.2.0.tar.gz.
File metadata
- Download URL: dbzero_modelkit-1.2.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5d24574a0068828e2a843231eb3a240bfc48d4feb3651d496d368223e725728
|
|
| MD5 |
6c150bf635179226c989d70814b0dd56
|
|
| BLAKE2b-256 |
c91bc6d7fec25ab06ec37aa4b443959d482ae6fcf7beb4eba0d05f34996e6fd8
|
Provenance
The following attestation bundles were made for dbzero_modelkit-1.2.0.tar.gz:
Publisher:
publish.yml on dbzero-software/dbzero-modelkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbzero_modelkit-1.2.0.tar.gz -
Subject digest:
f5d24574a0068828e2a843231eb3a240bfc48d4feb3651d496d368223e725728 - Sigstore transparency entry: 1967704291
- Sigstore integration time:
-
Permalink:
dbzero-software/dbzero-modelkit@d1b4528ed1b43a9ef041a661e4e4a526b7050fb9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dbzero-software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d1b4528ed1b43a9ef041a661e4e4a526b7050fb9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dbzero_modelkit-1.2.0-py3-none-any.whl.
File metadata
- Download URL: dbzero_modelkit-1.2.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bc66646688060bac89ad3ae8a1fcf02d7c5ed409437fea627eba1d5ec68d886
|
|
| MD5 |
a395b97209d80dd652bd6810d7bdf1b3
|
|
| BLAKE2b-256 |
f6c84bf785d7e37538e0319e69ca8bd1d8fb529d0cbee68fcdf24ab173e0f910
|
Provenance
The following attestation bundles were made for dbzero_modelkit-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on dbzero-software/dbzero-modelkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbzero_modelkit-1.2.0-py3-none-any.whl -
Subject digest:
1bc66646688060bac89ad3ae8a1fcf02d7c5ed409437fea627eba1d5ec68d886 - Sigstore transparency entry: 1967704406
- Sigstore integration time:
-
Permalink:
dbzero-software/dbzero-modelkit@d1b4528ed1b43a9ef041a661e4e4a526b7050fb9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dbzero-software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d1b4528ed1b43a9ef041a661e4e4a526b7050fb9 -
Trigger Event:
workflow_dispatch
-
Statement type: