Skip to main content

Persistent tree database for hierarchical metadata and file-backed datasets

Project description

LOTDB

Persistent tree database for hierarchical metadata and file-backed datasets.

LOTDB stands for Light Object Tree DB.

What it is

LOTDB stores data in StorageTree nodes:

  • each node can contain child nodes
  • each node can store arbitrary attributes
  • the full tree can be persisted with ZODB

This is especially useful for dataset pipelines where folder structure, file references, and metadata all belong together.

Installation

Local editable install:

pip install -e .

With optional IO helpers:

pip install -e .[io]

Basic usage

from lotdb import StorageTree

tree = StorageTree(key="dataset")
node = tree.get_node_path(["speaker_01", "session_a", "clip_001"])
node.set_attribute("label", "hello")

print(node.get_attribute("label"))

Persistent database usage

from lotdb import LOTDB

db = LOTDB(path="./data", name="lotdb.fs", new=True)
tree = db.open_connection()

tree.get_node_path(["speaker_01", "clip_001"]).set_attribute("duration", 1.23)
db.commit()
db.close_connection()
db.close()

Backward compatibility

The old short method names still work:

  • ga()
  • gn()
  • gns()
  • gna()

Readable wrappers were added so the API is easier to maintain and easier for weaker coding models to follow.

Import compatibility is also preserved for now:

  • new import: import lotdb
  • legacy imports still work: import TreeDB, import StorageTree
  • new database class: LOTDB
  • legacy alias still works: StorageTreeDatabase

Development

  • source packages live in src/lotdb and src/TreeDB
  • tests live in tests/
  • API notes live in docs/API.md

Publishing

PyPI publishing is configured with GitHub Actions via trusted publishing.

Recommended setup:

  • create a PyPI project named lotdb
  • add a trusted publisher on PyPI for this GitHub repository
  • publish by creating a GitHub release

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

lotdb-1.1.2.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

lotdb-1.1.2-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file lotdb-1.1.2.tar.gz.

File metadata

  • Download URL: lotdb-1.1.2.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lotdb-1.1.2.tar.gz
Algorithm Hash digest
SHA256 a93e988788e8429f55dae84db9f9d0cee64da33c735600eeb451a032fbcb9557
MD5 09ae431a43cbac4b8a7158d3b415c9ed
BLAKE2b-256 af48b76646acaf960a21897febac4c8d9134521bb8af059596db47bf416181f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for lotdb-1.1.2.tar.gz:

Publisher: publish.yml on HTill/LOTDB

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

File details

Details for the file lotdb-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: lotdb-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lotdb-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 26dc0f432d3197d111911df8f68f627993a0fca13826045f73a4539bfbd68f69
MD5 c5a9a3a3ba808dfef9c0cac4d2c478bc
BLAKE2b-256 cd5a03590ee762faa1bf24360769af3572dfa172d71ffdc407cd3a2bae0d9b23

See more details on using hashes here.

Provenance

The following attestation bundles were made for lotdb-1.1.2-py3-none-any.whl:

Publisher: publish.yml on HTill/LOTDB

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