dbetto 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. dbetto-1.0.2/.git_archival.txt +3 -0
  2. dbetto-1.0.2/.gitattributes +1 -0
  3. dbetto-1.0.2/.github/CONTRIBUTING.md +89 -0
  4. dbetto-1.0.2/.github/dependabot.yml +11 -0
  5. dbetto-1.0.2/.github/release.yml +5 -0
  6. dbetto-1.0.2/.github/workflows/cd.yml +56 -0
  7. dbetto-1.0.2/.github/workflows/ci.yml +71 -0
  8. dbetto-1.0.2/.gitignore +159 -0
  9. dbetto-1.0.2/.pre-commit-config.yaml +91 -0
  10. dbetto-1.0.2/.readthedocs.yaml +17 -0
  11. dbetto-1.0.2/LICENSE +19 -0
  12. dbetto-1.0.2/PKG-INFO +120 -0
  13. dbetto-1.0.2/README.md +78 -0
  14. dbetto-1.0.2/docs/attrsdict.rst +6 -0
  15. dbetto-1.0.2/docs/conf.py +79 -0
  16. dbetto-1.0.2/docs/index.rst +46 -0
  17. dbetto-1.0.2/docs/textdb.rst +6 -0
  18. dbetto-1.0.2/docs/tutorial.rst +189 -0
  19. dbetto-1.0.2/noxfile.py +109 -0
  20. dbetto-1.0.2/pyproject.toml +166 -0
  21. dbetto-1.0.2/src/dbetto/__init__.py +28 -0
  22. dbetto-1.0.2/src/dbetto/_version.py +16 -0
  23. dbetto-1.0.2/src/dbetto/_version.pyi +4 -0
  24. dbetto-1.0.2/src/dbetto/attrsdict.py +242 -0
  25. dbetto-1.0.2/src/dbetto/catalog.py +238 -0
  26. dbetto-1.0.2/src/dbetto/py.typed +0 -0
  27. dbetto-1.0.2/src/dbetto/textdb.py +353 -0
  28. dbetto-1.0.2/src/dbetto/time.py +35 -0
  29. dbetto-1.0.2/src/dbetto/utils.py +76 -0
  30. dbetto-1.0.2/tests/test_catalog.py +9 -0
  31. dbetto-1.0.2/tests/test_textdb.py +296 -0
  32. dbetto-1.0.2/tests/testdb/arrays.yaml +5 -0
  33. dbetto-1.0.2/tests/testdb/dir1/dir2/file4.yaml +1 -0
  34. dbetto-1.0.2/tests/testdb/dir1/file3.yaml +1 -0
  35. dbetto-1.0.2/tests/testdb/dir1/file5.yaml +1 -0
  36. dbetto-1.0.2/tests/testdb/dir1/file6.yaml +1 -0
  37. dbetto-1.0.2/tests/testdb/dir1/validity.yaml +29 -0
  38. dbetto-1.0.2/tests/testdb/dir2/file7.json +3 -0
  39. dbetto-1.0.2/tests/testdb/dir2/file8.json +3 -0
  40. dbetto-1.0.2/tests/testdb/file1.json +15 -0
  41. dbetto-1.0.2/tests/testdb/file2.yaml +6 -0
  42. dbetto-1.0.2/tests/testdb/file3.json +9 -0
@@ -0,0 +1,3 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,89 @@
1
+ See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
2
+ description of best practices for developing scientific packages.
3
+
4
+ [spc-dev-intro]: https://learn.scientific-python.org/development/
5
+
6
+ # Quick development
7
+
8
+ The fastest way to start with development is to use nox. If you don't have nox,
9
+ you can use `pipx run nox` to run it without installing, or `pipx install nox`.
10
+ If you don't have pipx (pip for applications), then you can install with
11
+ `pip install pipx` (the only case were installing an application with regular
12
+ pip is reasonable). If you use macOS, then pipx and nox are both in brew, use
13
+ `brew install pipx nox`.
14
+
15
+ To use, run `nox`. This will lint and test using every installed version of
16
+ Python on your system, skipping ones that are not installed. You can also run
17
+ specific jobs:
18
+
19
+ ```console
20
+ $ nox -s lint # Lint only
21
+ $ nox -s tests # Python tests
22
+ $ nox -s docs # Build and serve the docs
23
+ $ nox -s build # Make an SDist and wheel
24
+ ```
25
+
26
+ Nox handles everything for you, including setting up an temporary virtual
27
+ environment for each run.
28
+
29
+ # Setting up a development environment manually
30
+
31
+ You can set up a development environment by running:
32
+
33
+ ```bash
34
+ python3 -m venv .venv
35
+ source ./.venv/bin/activate
36
+ pip install -v -e .[dev]
37
+ ```
38
+
39
+ If you have the
40
+ [Python Launcher for Unix](https://github.com/brettcannon/python-launcher), you
41
+ can instead do:
42
+
43
+ ```bash
44
+ py -m venv .venv
45
+ py -m install -v -e .[dev]
46
+ ```
47
+
48
+ # Pre-commit
49
+
50
+ You should prepare pre-commit, which will help you by checking that commits pass
51
+ required checks:
52
+
53
+ ```bash
54
+ pip install pre-commit # or brew install pre-commit on macOS
55
+ pre-commit install # Will install a pre-commit hook into the git repo
56
+ ```
57
+
58
+ You can also/alternatively run `pre-commit run` (changes only) or
59
+ `pre-commit run --all-files` to check even without installing the hook.
60
+
61
+ # Testing
62
+
63
+ Use pytest to run the unit checks:
64
+
65
+ ```bash
66
+ pytest
67
+ ```
68
+
69
+ # Coverage
70
+
71
+ Use pytest-cov to generate coverage reports:
72
+
73
+ ```bash
74
+ pytest --cov=dbetto
75
+ ```
76
+
77
+ # Building docs
78
+
79
+ You can build and serve the docs using:
80
+
81
+ ```bash
82
+ nox -s docs
83
+ ```
84
+
85
+ You can build the docs only with:
86
+
87
+ ```bash
88
+ nox -s docs --non-interactive
89
+ ```
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ groups:
9
+ actions:
10
+ patterns:
11
+ - "*"
@@ -0,0 +1,5 @@
1
+ changelog:
2
+ exclude:
3
+ authors:
4
+ - dependabot
5
+ - pre-commit-ci
@@ -0,0 +1,56 @@
1
+ name: CD
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ env:
18
+ # Many color libraries just need this to be set to any value, but at least
19
+ # one distinguishes color depth, where "3" -> "256-bit color".
20
+ FORCE_COLOR: 3
21
+
22
+ jobs:
23
+ dist:
24
+ name: Distribution build
25
+ runs-on: ubuntu-latest
26
+
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0
31
+
32
+ - uses: hynek/build-and-inspect-python-package@v2
33
+
34
+ publish:
35
+ needs: [dist]
36
+ name: Publish to PyPI
37
+ environment: pypi
38
+ permissions:
39
+ id-token: write
40
+ attestations: write
41
+ contents: read
42
+ runs-on: ubuntu-latest
43
+ if: github.event_name == 'release' && github.event.action == 'published'
44
+
45
+ steps:
46
+ - uses: actions/download-artifact@v4
47
+ with:
48
+ name: Packages
49
+ path: dist
50
+
51
+ - name: Generate artifact attestation for sdist and wheel
52
+ uses: actions/attest-build-provenance@v2.1.0
53
+ with:
54
+ subject-path: "dist/*"
55
+
56
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,71 @@
1
+ name: CI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ env:
15
+ # Many color libraries just need this to be set to any value, but at least
16
+ # one distinguishes color depth, where "3" -> "256-bit color".
17
+ FORCE_COLOR: 3
18
+
19
+ jobs:
20
+ pre-commit:
21
+ name: Format
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.x"
30
+ - uses: pre-commit/action@v3.0.1
31
+ with:
32
+ extra_args: --all-files
33
+ - name: Run PyLint
34
+ run: pipx run nox -s pylint -- --output-format=github
35
+
36
+ checks:
37
+ name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
38
+ runs-on: ${{ matrix.runs-on }}
39
+ needs: [pre-commit]
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ python-version: ["3.9", "3.13"]
44
+ runs-on: [ubuntu-latest, windows-latest, macos-14]
45
+
46
+ include:
47
+ - python-version: "pypy-3.10"
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+ with:
53
+ fetch-depth: 0
54
+
55
+ - uses: actions/setup-python@v5
56
+ with:
57
+ python-version: ${{ matrix.python-version }}
58
+ allow-prereleases: true
59
+
60
+ - name: Install package
61
+ run: python -m pip install .[test]
62
+
63
+ - name: Test package
64
+ run: >-
65
+ python -m pytest -ra --cov --cov-report=xml --cov-report=term
66
+ --durations=20
67
+
68
+ - name: Upload coverage report
69
+ uses: codecov/codecov-action@v5.1.1
70
+ with:
71
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,159 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+ docs/api/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
99
+ __pypackages__/
100
+
101
+ # Celery stuff
102
+ celerybeat-schedule
103
+ celerybeat.pid
104
+
105
+ # SageMath parsed files
106
+ *.sage.py
107
+
108
+ # Environments
109
+ .env
110
+ .venv
111
+ env/
112
+ venv/
113
+ ENV/
114
+ env.bak/
115
+ venv.bak/
116
+
117
+ # Spyder project settings
118
+ .spyderproject
119
+ .spyproject
120
+
121
+ # Rope project settings
122
+ .ropeproject
123
+
124
+ # mkdocs documentation
125
+ /site
126
+
127
+ # mypy
128
+ .mypy_cache/
129
+ .dmypy.json
130
+ dmypy.json
131
+
132
+ # Pyre type checker
133
+ .pyre/
134
+
135
+ # pytype static type analyzer
136
+ .pytype/
137
+
138
+ # Cython debug symbols
139
+ cython_debug/
140
+
141
+ # setuptools_scm
142
+ src/*/_version.py
143
+
144
+
145
+ # ruff
146
+ .ruff_cache/
147
+
148
+ # OS specific stuff
149
+ .DS_Store
150
+ .DS_Store?
151
+ ._*
152
+ .Spotlight-V100
153
+ .Trashes
154
+ ehthumbs.db
155
+ Thumbs.db
156
+
157
+ # Common editor files
158
+ *~
159
+ *.swp
@@ -0,0 +1,91 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
3
+ autofix_commit_msg: "style: pre-commit fixes"
4
+
5
+ exclude: ^.cruft.json|.copier-answers.yml$
6
+
7
+ repos:
8
+ - repo: https://github.com/adamchainz/blacken-docs
9
+ rev: "1.19.1"
10
+ hooks:
11
+ - id: blacken-docs
12
+ additional_dependencies: [black==24.*]
13
+ exclude: ^README.md
14
+
15
+ - repo: https://github.com/pre-commit/pre-commit-hooks
16
+ rev: "v5.0.0"
17
+ hooks:
18
+ - id: check-added-large-files
19
+ - id: check-case-conflict
20
+ - id: check-merge-conflict
21
+ - id: check-symlinks
22
+ - id: check-yaml
23
+ - id: debug-statements
24
+ - id: end-of-file-fixer
25
+ - id: mixed-line-ending
26
+ - id: name-tests-test
27
+ args: ["--pytest-test-first"]
28
+ - id: requirements-txt-fixer
29
+ - id: trailing-whitespace
30
+
31
+ - repo: https://github.com/pre-commit/pygrep-hooks
32
+ rev: "v1.10.0"
33
+ hooks:
34
+ - id: rst-backticks
35
+ - id: rst-directive-colons
36
+ - id: rst-inline-touching-normal
37
+
38
+ - repo: https://github.com/rbubley/mirrors-prettier
39
+ rev: "v3.3.3"
40
+ hooks:
41
+ - id: prettier
42
+ types_or: [yaml, markdown, html, css, scss, javascript, json]
43
+ args: [--prose-wrap=always]
44
+
45
+ - repo: https://github.com/astral-sh/ruff-pre-commit
46
+ rev: "v0.7.4"
47
+ hooks:
48
+ - id: ruff
49
+ args: ["--fix", "--show-fixes"]
50
+ - id: ruff-format
51
+
52
+ - repo: https://github.com/pre-commit/mirrors-mypy
53
+ rev: "v1.13.0"
54
+ hooks:
55
+ - id: mypy
56
+ files: src|tests
57
+ stages: [manual]
58
+ args: []
59
+ additional_dependencies:
60
+ - pytest
61
+
62
+ - repo: https://github.com/codespell-project/codespell
63
+ rev: "v2.3.0"
64
+ hooks:
65
+ - id: codespell
66
+
67
+ - repo: https://github.com/shellcheck-py/shellcheck-py
68
+ rev: "v0.10.0.1"
69
+ hooks:
70
+ - id: shellcheck
71
+
72
+ - repo: local
73
+ hooks:
74
+ - id: disallow-caps
75
+ name: Disallow improper capitalization
76
+ language: pygrep
77
+ entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
78
+ exclude: .pre-commit-config.yaml
79
+
80
+ - repo: https://github.com/abravalheri/validate-pyproject
81
+ rev: "v0.23"
82
+ hooks:
83
+ - id: validate-pyproject
84
+ additional_dependencies: ["validate-pyproject-schema-store[all]"]
85
+
86
+ - repo: https://github.com/python-jsonschema/check-jsonschema
87
+ rev: "0.29.4"
88
+ hooks:
89
+ - id: check-dependabot
90
+ - id: check-github-workflows
91
+ - id: check-readthedocs
@@ -0,0 +1,17 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ version: 2
5
+
6
+ build:
7
+ os: ubuntu-22.04
8
+ tools:
9
+ python: "3.12"
10
+ commands:
11
+ - asdf plugin add uv
12
+ - asdf install uv latest
13
+ - asdf global uv latest
14
+ - uv venv
15
+ - uv pip install .[docs]
16
+ - .venv/bin/python -m sphinx -T -b html -d docs/_build/doctrees -D
17
+ language=en docs $READTHEDOCS_OUTPUT/html
dbetto-1.0.2/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2024 Luigi Pertoldi
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
dbetto-1.0.2/PKG-INFO ADDED
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: dbetto
3
+ Version: 1.0.2
4
+ Summary: A tiny text file based database
5
+ Project-URL: Homepage, https://github.com/gipert/dbetto
6
+ Project-URL: Bug Tracker, https://github.com/gipert/dbetto/issues
7
+ Project-URL: Discussions, https://github.com/gipert/dbetto/discussions
8
+ Project-URL: Changelog, https://github.com/gipert/dbetto/releases
9
+ Author-email: Luigi Pertoldi <gipert@pm.me>
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 1 - Planning
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Scientific/Engineering
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.9
27
+ Requires-Dist: pyyaml
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest-cov>=3; extra == 'dev'
30
+ Requires-Dist: pytest>=6; extra == 'dev'
31
+ Provides-Extra: docs
32
+ Requires-Dist: furo>=2023.08.17; extra == 'docs'
33
+ Requires-Dist: myst-parser>=0.13; extra == 'docs'
34
+ Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
35
+ Requires-Dist: sphinx-copybutton; extra == 'docs'
36
+ Requires-Dist: sphinx-inline-tabs; extra == 'docs'
37
+ Requires-Dist: sphinx>=7.0; extra == 'docs'
38
+ Provides-Extra: test
39
+ Requires-Dist: pytest-cov>=3; extra == 'test'
40
+ Requires-Dist: pytest>=6; extra == 'test'
41
+ Description-Content-Type: text/markdown
42
+
43
+ # 📂 dbetto
44
+
45
+ A tiny text-based database.
46
+
47
+ [![PyPI](https://img.shields.io/pypi/v/dbetto?logo=pypi)](https://pypi.org/project/dbetto/)
48
+ ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/gipert/dbetto?logo=git)
49
+ [![GitHub Workflow Status](https://img.shields.io/github/checks-status/gipert/dbetto/main?label=main%20branch&logo=github)](https://github.com/gipert/dbetto/actions)
50
+ [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
51
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
52
+ [![Codecov](https://img.shields.io/codecov/c/github/gipert/dbetto?logo=codecov)](https://app.codecov.io/gh/gipert/dbetto)
53
+ ![GitHub issues](https://img.shields.io/github/issues/gipert/dbetto?logo=github)
54
+ ![GitHub pull requests](https://img.shields.io/github/issues-pr/gipert/dbetto?logo=github)
55
+ ![License](https://img.shields.io/github/license/gipert/dbetto)
56
+ [![Read the Docs](https://img.shields.io/readthedocs/dbetto?logo=readthedocs)](https://dbetto.readthedocs.io)
57
+
58
+ _dbetto_ is a lightweight Python library that enables seamless access and
59
+ management of **text-based databases** (JSON/YAML) scattered across your
60
+ filesystem. Whether you're handling nested data structures or querying data by
61
+ validity periods, _dbetto_ simplifies it all with an intuitive interface.
62
+
63
+ The project was originally developed to efficiently manage metadata for the
64
+ LEGEND experiment.
65
+
66
+ ### Key Features
67
+
68
+ - Access JSON/YAML files like a Python dictionary
69
+ - Attribute-style access with tab-completion for rapid query
70
+ - Time-sensitive data querying with validity rules
71
+ - Data remapping and grouping functionalities
72
+
73
+ ## Showcase
74
+
75
+ Install from PyPI:
76
+
77
+ ```bash
78
+ pip install dbetto
79
+ ```
80
+
81
+ Access data arbitrarily structured as JSON or YAML files:
82
+
83
+ ```python
84
+ >>> from dbetto import TextDB
85
+ >>> db = TextDB("/path/to/data/folder")
86
+ >>> db["dir1"]["file1.json"]["value"]
87
+ 1
88
+ >>> db.dir1.file1.value
89
+ 1
90
+ ```
91
+
92
+ Query data valid on a given time period:
93
+
94
+ ```python
95
+ >>> from datetime import datetime
96
+ >>> db.on(datetime(2023, 1, 10, 9, 53, 0)).value
97
+ 3
98
+ ```
99
+
100
+ Map data according to alternative keys:
101
+
102
+ ```python
103
+ >>> chmap = db["detectors.yaml"]
104
+ >>> chmap.V05266A
105
+ {'name': 'V05266A',
106
+ 'location': {'string': 1, 'position': 4},
107
+ 'daq': {'crate': 0,
108
+ 'rawid': 1104003,
109
+ ...
110
+ >>> chmap.map("daq.rawid")[1104003]
111
+ {'name': 'V05266A',
112
+ 'location': {'string': 1, 'position': 4},
113
+ 'daq': {'crate': 0,
114
+ 'rawid': 1104003}}
115
+ >>> grouped = chmap.group("electronics.cc4.id")["C3"]
116
+ >>> grouped.map("name").keys()
117
+ dict_keys(['V02160A', 'V02160B', 'V05261B', 'V05266A', 'V05266B', 'V05268B', 'V05612A'])
118
+ ```
119
+
120
+ Have a look at the [docs](https://dbetto.readthedocs.io) for more!