d2bmat is a Python package with a set of utility functions to map Python schemas and parsers between 2 different database platforms. Its development is strongly tied to Materials Science databases, and as an example, we mainly worked in a mapping between NOMAD and openBIS.
The main objective of this repository is to provide an interface for database admins so that researchers only focus on creating schemas and parsers in one common notation, without having to worry about one or another database languages.
If you want to install it, do:
pip install d2bmatNote: the package is still in development and we did not deploy any version to PyPI. If you want to install this package, you need to clone and pip install it locally.
If you want to develop locally this package, clone the project and enter in the workspace folder:
git clone https://github.com/JosePizarro3/d2bmat.git
cd d2bmatCreate a virtual environment (you can use Python>3.9) in your workspace:
python3 -m venv .venv
source .venv/bin/activateAnd run the following commands:
pip install --upgrade pip
pip install uv
uv pip install -e '.[dev]'You can locally run the tests by doing:
python -m pytest -sv testswhere the -s and -v options toggle the output verbosity.
You can also generate a local coverage report:
python -m pytest --cov=src testsWe use Ruff for formatting and linting the code following the rules specified in the pyproject.toml. You can run locally:
ruff check .This will produce an output with the specific issues found. In order to auto-fix them, run:
ruff format . --checkIf some issues are not possible to fix automatically, you will need to visit the file and fix them by hand.
The main code developers are:
| Name | |
|---|---|
| Dr. Jose M. Pizarro | jose.pizarro-blanco@bam.de |