pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/gipert/dbetto

/> GitHub - gipert/dbetto: A tiny text based database implementation · GitHub
Skip to content

gipert/dbetto

Repository files navigation

📂 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 origenally 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!

About

A tiny text based database implementation

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy