A tiny text file based database
Project description
📂 dbetto
A tiny text-based database.
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!
Project details
Release history Release notifications | RSS feed
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 dbetto-1.3.0.tar.gz.
File metadata
- Download URL: dbetto-1.3.0.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b239ec4de4d2c138c17dacf7a8c5d48e52d6d7413fe830848ce23d2bd8c73d7
|
|
| MD5 |
32be6129051c9a150ad44df80cb0330c
|
|
| BLAKE2b-256 |
f29899c65199f6a5c88116b79692651b9094c8de91614505c55d4d06b92adc58
|
Provenance
The following attestation bundles were made for dbetto-1.3.0.tar.gz:
Publisher:
cd.yml on gipert/dbetto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbetto-1.3.0.tar.gz -
Subject digest:
8b239ec4de4d2c138c17dacf7a8c5d48e52d6d7413fe830848ce23d2bd8c73d7 - Sigstore transparency entry: 640856548
- Sigstore integration time:
-
Permalink:
gipert/dbetto@b6e39f1aba9ac5c3efc6da041275f2b782e7716e -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/gipert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@b6e39f1aba9ac5c3efc6da041275f2b782e7716e -
Trigger Event:
release
-
Statement type:
File details
Details for the file dbetto-1.3.0-py3-none-any.whl.
File metadata
- Download URL: dbetto-1.3.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93d5287c862865351accab37426c1b029418b93b6d4bde76662bc3f834807e88
|
|
| MD5 |
6a5bb92473596e1b047f606d58c4774f
|
|
| BLAKE2b-256 |
ca385e518593587b680c20195847138c3a341fd2d94afe801e84ec1098b09e63
|
Provenance
The following attestation bundles were made for dbetto-1.3.0-py3-none-any.whl:
Publisher:
cd.yml on gipert/dbetto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbetto-1.3.0-py3-none-any.whl -
Subject digest:
93d5287c862865351accab37426c1b029418b93b6d4bde76662bc3f834807e88 - Sigstore transparency entry: 640856556
- Sigstore integration time:
-
Permalink:
gipert/dbetto@b6e39f1aba9ac5c3efc6da041275f2b782e7716e -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/gipert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@b6e39f1aba9ac5c3efc6da041275f2b782e7716e -
Trigger Event:
release
-
Statement type: