Skip to main content

📂 dbetto

A tiny text-based database.

PyPI GitHub tag (latest by date) GitHub Workflow Status pre-commit Code style: black Codecov GitHub issues GitHub pull requests License Read the Docs

dbetto is a lightweight Python library that enables seamless access and management of text-based databases (JSON/YAML) scattered across your filesystem. Whether you're handling nested data structures or querying data by validity periods, dbetto simplifies it all with an intuitive interface.

The project was originally developed to efficiently manage metadata for the LEGEND experiment.

Key Features

  • Access JSON/YAML files like a Python dictionary
  • Attribute-style access with tab-completion for rapid query
  • Time-sensitive data querying with validity rules
  • Data remapping and grouping functionalities

Showcase

Install from PyPI:

pip install dbetto

Access data arbitrarily structured as JSON or YAML files:

>>> from dbetto import TextDB
>>> db = TextDB("/path/to/data/folder")
>>> db["dir1"]["file1.json"]["value"]
1
>>> db.dir1.file1.value
1

Query data valid on a given time period:

>>> from datetime import datetime
>>> db.on(datetime(2023, 1, 10, 9, 53, 0)).value
3

Map data according to alternative keys:

>>> chmap = db["detectors.yaml"]
>>> chmap.V05266A
{'name': 'V05266A',
 'location': {'string': 1, 'position': 4},
 'daq': {'crate': 0,
  'rawid': 1104003,
 ...
>>> chmap.map("daq.rawid")[1104003]
{'name': 'V05266A',
 'location': {'string': 1, 'position': 4},
 'daq': {'crate': 0,
  'rawid': 1104003}}
>>> grouped = chmap.group("electronics.cc4.id")["C3"]
>>> grouped.map("name").keys()
dict_keys(['V02160A', 'V02160B', 'V05261B', 'V05266A', 'V05266B', 'V05268B', 'V05612A'])

Have a look at the docs for more!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbetto-1.4.0.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

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

dbetto-1.4.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file dbetto-1.4.0.tar.gz.

File metadata

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

File hashes

Hashes for dbetto-1.4.0.tar.gz
Algorithm Hash digest
SHA256 58dd80d02d97d233cc2bf6f78fdba7ae85a6a4f9190496730e659eb9d0ab6339
MD5 460c430e667d6c2e80953a51557bedc8
BLAKE2b-256 b468116b480c066de06d418f2558f798979853b55a8c9be02c832005866897b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbetto-1.4.0.tar.gz:

Publisher: cd.yml on gipert/dbetto

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

File details

Details for the file dbetto-1.4.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for dbetto-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9da269751150c6aca48b31d8212de99eea3c7f4d6dff6d36bddb06550ac2fbbc
MD5 66c9f504aaa57d37460f9a1a6cdd2920
BLAKE2b-256 eeb69cb5692af8569508fda4273ef2cb38c1db9b41e87b2412442121e089bb2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbetto-1.4.0-py3-none-any.whl:

Publisher: cd.yml on gipert/dbetto

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

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.7

2 files

1.3.6

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

Supported by

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