Skip to content

Commit 0028de8

Browse files
authored
Merge pull request #8 from BAMresearch/4-add-documentation-page-on-how-to-use-the-app-with-screenshots-too
Add documentation page on how to use the app (with screenshots too)
2 parents 002682e + 16b322b commit 0028de8

File tree

2 files changed

+23
-117
lines changed

2 files changed

+23
-117
lines changed

README.md

Lines changed: 21 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,60 @@
1-
# BAM Data Store: MasterDataChecker
1+
# Masterdata Checker
22

3-
The `masterdata_checker` is a Python package used to check the correctness of a given Masterdata definitions file with respect to the entities already registered in the BAM Data Store. The package provides a Graphical User Interface (GUI) on which the user can:
4-
- Choose a local Masterdata file to be checked.
3+
The `masterdata_checker` is a Django app used to check the correctness of a given Masterdata definitions file with respect to the entities already registered in the BAM Data Store (as defined in the [`bam-masterdata`](https://github.com/BAMresearch/bam-masterdata) package). In the app, you can:
4+
- Log in your openBIS instance.
5+
- Run checks of a local Masterdata Excel file. **Note**: only supported file formats are `.xls` and `.xlsx`
56
- Revise the errors logs to correct mistakes in the original Masterdata file.
6-
- Depending on the credentials access, select a specific BAM Data Store instance and the Masterdata definitions therein.
77

8-
We also provide a Jupyter Notebook as a tutorial to execute the API of `masterdata_checker`.
9-
10-
11-
<!--
12-
## Getting started
13-
14-
Add here installation instructions once the package is deployed -->
158

169
## Development
1710

1811
If you want to develop locally this package, clone the project and enter in the workspace folder:
1912
```sh
20-
git clone https://git.bam.de/bam-data-store/development/masterdata_checker.git
13+
git clone https://github.com/BAMresearch/masterdata-checker
2114
cd masterdata_checker
2215
```
2316

24-
Note you need to have installed the Python interface for the Tcl/Tk GUI toolkit ([`tkinter`](https://docs.python.org/3/library/tkinter.html)). If you don't have it, you can run:
25-
```sh
26-
sudo apt-get install python3-tk
27-
```
28-
29-
#### Option 1: Virtual environment with `venv`
30-
31-
Create a virtual environment (you can use Python>3.9) in your workspace:
32-
```sh
33-
python3 -m venv .venv
34-
source .venv/bin/activate
35-
```
36-
37-
Make sure `pip` is upgraded:
38-
```sh
39-
pip install --upgrade pip
40-
```
41-
42-
Install the package with the desired optional dependencies (specified in between brackets, e.g., `[dev]` or `[jupy]`) and in editable mode (with the added `-e` flag):
43-
```sh
44-
pip install -e '.[dev,jupy,docu]'
45-
```
46-
47-
#### Option 2: `uv` virtual environment
48-
4917
We recommend using `uv` for fast pip installation of the package. In this case, you can instead create a virtual environment by doing:
5018
```sh
5119
uv venv
5220
source .venv/bin/activate
5321
```
5422

55-
Install the package with the desired optional dependencies (specified in between brackets, e.g., `[dev]` or `[jupy]`) and in editable mode (with the added `-e` flag):
23+
Install the package with the desired optional dependencies (specified in between brackets, e.g., `[dev]`) and in editable mode (with the added `-e` flag):
5624
```sh
57-
uv pip install -e '.[dev,jupy,docu]'
25+
uv pip install -e '.[dev]'
5826
```
5927

60-
### Run the tests
28+
### Launch the Django app
6129

62-
You can locally run the tests by doing:
30+
In order to launch the Django app, navigate to the `masterdata_checker/` subfolder:
6331
```sh
64-
python -m pytest -sv tests
65-
```
66-
67-
where the `-s` and `-v` options toggle the output verbosity.
68-
69-
You can also generate a local coverage report:
70-
```sh
71-
python -m pytest --cov=src tests
72-
```
73-
74-
### Run auto-formatting and linting
75-
76-
We use [Ruff](https://docs.astral.sh/ruff/) for formatting and linting the code following the rules specified in the `pyproject.toml`. You can run locally:
77-
```sh
78-
ruff check .
79-
```
80-
81-
This will produce an output with the specific issues found. In order to auto-fix them, run:
82-
```sh
83-
ruff format . --check
84-
```
85-
86-
If some issues are not possible to fix automatically, you will need to visit the file and fix them by hand.
87-
88-
<!-- ### Debugging
89-
90-
For interactive debugging of the tests, use `pytest` with the `--pdb` flag. We recommend using an IDE for debugging, e.g., _VSCode_. If that is the case, add the following snippet to your `.vscode/launch.json`:
91-
```json
92-
{
93-
"configurations": [
94-
{
95-
"name": "<descriptive tag>",
96-
"type": "debugpy",
97-
"request": "launch",
98-
"cwd": "${workspaceFolder}",
99-
"program": "${workspaceFolder}/.pyenv/bin/pytest",
100-
"justMyCode": true,
101-
"env": {
102-
"_PYTEST_RAISE": "1"
103-
},
104-
"args": [
105-
"-sv",
106-
"--pdb",
107-
"<path-to-plugin-tests>",
108-
]
109-
}
110-
]
111-
}
32+
cd masterdata_checker
11233
```
11334

114-
where `<path-to-plugin-tests>` must be changed to the local path to the test module to be debugged.
115-
116-
The settings configuration file `.vscode/settings.json` automatically applies the linting and formatting upon saving the modified file. -->
117-
118-
### Documentation on Github pages
119-
120-
To view the documentation locally, install the extra packages using:
35+
And run:
12136
```sh
122-
uv pip install -e '[docu]'
37+
python manage.py runserver
12338
```
12439

125-
The first time, build the server:
40+
This will run the Django app server:
12641
```sh
127-
mkdocs build
128-
```
42+
Performing system checks...
12943

130-
Run the documentation server:
131-
```sh
132-
mkdocs serve
44+
System check identified no issues (0 silenced).
45+
June 05, 2025 - 06:24:20
46+
Django version 5.2.1, using settings 'checker.settings'
47+
Starting development server at http://127.0.0.1:8000/
48+
Quit the server with CONTROL-C.
13349
```
13450

135-
The output looks like:
136-
```sh
137-
INFO - Building documentation...
138-
INFO - Cleaning site directory
139-
INFO - [14:07:47] Watching paths for changes: 'docs', 'mkdocs.yml'
140-
INFO - [14:07:47] Serving on http://127.0.0.1:8000/
141-
```
51+
Simply click on the localhost address `http://127.0.0.1:8000/` to launch the app.
14252

143-
Simply click on `http://127.0.0.1:8000/`. The changes in the `md` files of the documentation are inmediately reflected when the files are saved (the local web will automatically refresh).
14453

14554
## Main contributors
14655

14756
| Name | E-mail | Role |
148-
|------|------------|--------|-----------------|
57+
|------|------------|--------|
14958
| Carlos Madariaga | [[email protected]]([email protected]) | Admin |
15059
| Dr. Jose M. Pizarro | [[email protected]]([email protected]) | Maintainer |
15160
| Jörg Rädler | [[email protected]]([email protected]) | Maintainer |

pyproject.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ classifiers = [
1414
"Programming Language :: Python :: 3.12",
1515
]
1616
name = "masterdata-checker"
17-
description = "A Python tool to check the correctness of a given Masterdata definitions file with respect to the entities already registered in the BAM Data Store."
17+
description = "A Django app to check the correctness of a Masterdata definitions file with respect to the entities already registered in an openBIS instance."
1818
dynamic = ["version"]
1919
readme = "README.md"
20-
requires-python = ">=3.9"
20+
requires-python = ">=3.10"
2121
authors = [
2222
{ name = "Carlos Madariaga", email = "[email protected]" },
2323
{ name = "Jose M. Pizarro", email = "[email protected]" },
@@ -49,9 +49,6 @@ dev = [
4949
"structlog==24.4.0",
5050
]
5151

52-
[project.scripts]
53-
masterdata_checker = "masterdata_checker.cli:cli"
54-
5552
[tool.ruff]
5653
# Exclude a variety of commonly ignored directories.
5754
include = ["masterdata_checker/*.py", "tests/*.py"]

0 commit comments

Comments
 (0)