Skip to main content

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
  • dbzero>=0.3.0

Included Models

  • ActiveBase and ActiveIndex for objects that are active only within a date or datetime range.
  • Calendar, MonthCalendar, get_month_index, and get_date_from_month_index for sparse date-based values.
  • LanguageCode and ML_String for primary text values with optional translations.
  • FiFoQueue and FQ_Item for dbzero-backed FIFO queues.
  • MonthStore for one-object-per-month storage with lazy item creation.
  • ObjectLock for 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

dbzero_modelkit-1.1.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbzero_modelkit-1.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file dbzero_modelkit-1.1.0.tar.gz.

File metadata

  • Download URL: dbzero_modelkit-1.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbzero_modelkit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7a54fe9be6e36a142350f15ff3bd906d039f2059521be183643e747eb54f007b
MD5 7910113ae41a16425d181a7fa4035686
BLAKE2b-256 d87a7c9216f09e78e6932e3006ccb939e3c58982ec3fac4ce522a9f1bfa9455a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbzero_modelkit-1.1.0.tar.gz:

Publisher: publish.yml on dbzero-software/dbzero-modelkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbzero_modelkit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: dbzero_modelkit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbzero_modelkit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b87f899cd614a1329059df1e4c4528e0dfeea0f3ae3c0f7c21b019c6975488c
MD5 324a0caf855c96eb3e019780cccac0c9
BLAKE2b-256 a31536896b5d8444e531c7e7f302ce24c6b1cf1cb9551f4ab7b595a35d37cadd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbzero_modelkit-1.1.0-py3-none-any.whl:

Publisher: publish.yml on dbzero-software/dbzero-modelkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page