Overview¶
MetaboLights WS3¶
The mtbls-ws3 is Python application stack to manage MetaboLights open repository. It provides REST API endpoints for the metabolomics community and other MetaboLights applications.
Features¶
- REST API endpoints with FastAPI and API documentation (Redoc).
- Json serializable models with pydantic library.
- Serve the selected REST API endpoints (e.g., submission, curation, public, etc.).
- A new design with best practices, including dependency inversion, testability, modularity, maintainability, and extensibility.
- Jwt based extensible authentication, authorization, identity management
- Improved logging mechanism
Development Environment¶
Development environment for linux or mac
# install python package manager uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# add $HOME/.local/bin to your PATH, either restart your shell or run
export PATH=$HOME/.local/bin:$PATH
# If there is no git, install it from https://git-scm.com/downloads
# Linux command to install git
# apt update; apt install git -y
# Mac command to install git
# brew install git
# clone project from github
git clone https://github.com/EBI-Metabolights/mtbls-ws3.git
cd mtbls-ws3
# install python with uv
uv python install 3.13
# install python dependencies
uv sync --extra ws3
# install pre-commit to check repository integrity and format checking
uv run pre-commit
#########################################################################################
# ๐ Validate pyproject.toml...................................(no files to check)Skipped
# ๐ Security ยท Detect hardcoded secrets...........................................Passed
# ๐ข Markdown ยท Format markdown...................................................Passed
# ๐ข Check large files............................................................Passed
# ๐ข Check toml files.........................................(no files to check)Skipped
# ๐ข Check json files.........................................(no files to check)Skipped
# ๐ข Format json files........................................(no files to check)Skipped
# ๐ข Check yaml files.............................................................Passed
# ๐ข Check end of file character...................................................Passed
# ๐ข Check training whitespaces...................................................Passed
# โ
Check training whitespaces................................(no files to check)Skipped
# ๐ Detect missing __init__.py files..............................................Passed
# ๐ Check Format with Ruff....................................(no files to check)Skipped
# ๐ python ยท Format with Ruff.................................(no files to check)Skipped
# ๐ชต architecture and package structure check (lint-imports).......................Passed
#########################################################################################
uv run pytest
# Run and test webservice server on local
# test curator metabolights-help@ebi.ac.uk with password test.123
# test user metabolights-dev@ebi.ac.uk with password test.123
# test studies MTBLS800001 MTBLS800002 MTBLS800003
uv run python tests/run/main_local.py
# open your IDE (vscode, pycharm, etc.) and set python interpreter as .venv/bin/python
Design & Development¶
You can find design details Design Section
Before committing and pushing your updates:
- Add/update unit tests.
- Run following commands and fix all issues and