NoSQL in-memory Tango DB for project testing
Project description
No SQL in-memory Tango database for testing.
It provides
- An human readable data structure based on Yaml to describe the content of a tango database;
- Helpers to launch such database in python for testing.
The code was previously at:
- https://github.com/tango-controls/pytango/blob/a8f6a3bfbf547f5b1bb22772280f0eb6e655486f/tango/databaseds/db_access/beacon.py
- https://gitlab.esrf.fr/bliss/bliss/-/commit/c17bcc328d337de856449e3826023dc9f7dac858
Connectors
Two connectors are provided using the same data structure:
beaconusing a Redis/Beacon infrastructure to store the database;yamlusing direct yaml files with in-memory only storage.
Command line
The database can be launched the following ways.
Using the actual Redis database:
NosqlTangoDB --port 10000 --db_access=beacon 2
Using a specifuc directory containing Yaml files:
NosqlTangoDB --port 10000 --db_access=yaml:tests/data/test1/ 2
Python
The following code can be used in Python projects.
It spawns the database process with a context manager.
The port is yield when the database is ready to be used.
It finally terminates the database process.
from nosqltangodb import helper
with helper.running_db(
name="2",
db_access="yaml",
yaml_root=yaml_root,
port="auto",
debug_protocol=True,
update_tango_host=True,
timeout=10,
) as db:
print("Tango DB port:", db.port)
Project release
# ~/.pypirc
[nosql-tango-db]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-...
pip wheel . --wheel-dir=dist
twine upload dist/nosqltangodb-*.whl -r nosqltangodb
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 nosqltangodb-1.0.6-py3-none-any.whl.
File metadata
- Download URL: nosqltangodb-1.0.6-py3-none-any.whl
- Upload date:
- Size: 46.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97151e031e2d8b7d5afc339836580a8b5c243b77ca0c6d10e6783976fb1920e1
|
|
| MD5 |
300e980bc3674780280040a819f0f29b
|
|
| BLAKE2b-256 |
98b82773b84b080cf3efdcf6dc5d6924eda2fa605fae92f2c331eed231eed8cc
|