bam-masterdata 0.0.0__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 (80) hide show
  1. bam_masterdata-0.0.0/.coveragerc +4 -0
  2. bam_masterdata-0.0.0/.github/workflows/actions.yml +72 -0
  3. bam_masterdata-0.0.0/.github/workflows/coveralls.yml +44 -0
  4. bam_masterdata-0.0.0/.github/workflows/mkdocs-deploy.yml +29 -0
  5. bam_masterdata-0.0.0/.github/workflows/publish.yml +43 -0
  6. bam_masterdata-0.0.0/.gitignore +177 -0
  7. bam_masterdata-0.0.0/.gitmodules +3 -0
  8. bam_masterdata-0.0.0/.vscode/settings.json +85 -0
  9. bam_masterdata-0.0.0/PKG-INFO +176 -0
  10. bam_masterdata-0.0.0/README.md +136 -0
  11. bam_masterdata-0.0.0/bam_masterdata/__init__.py +0 -0
  12. bam_masterdata-0.0.0/bam_masterdata/_version.py +16 -0
  13. bam_masterdata-0.0.0/bam_masterdata/cli/__init__.py +1 -0
  14. bam_masterdata-0.0.0/bam_masterdata/cli/cli.py +194 -0
  15. bam_masterdata-0.0.0/bam_masterdata/cli/entities_to_excel.py +99 -0
  16. bam_masterdata-0.0.0/bam_masterdata/cli/entities_to_json.py +67 -0
  17. bam_masterdata-0.0.0/bam_masterdata/cli/fill_masterdata.py +426 -0
  18. bam_masterdata-0.0.0/bam_masterdata/datamodel/__init__.py +0 -0
  19. bam_masterdata-0.0.0/bam_masterdata/datamodel/collection_types.py +317 -0
  20. bam_masterdata-0.0.0/bam_masterdata/datamodel/dataset_types.py +1497 -0
  21. bam_masterdata-0.0.0/bam_masterdata/datamodel/object_types.py +13560 -0
  22. bam_masterdata-0.0.0/bam_masterdata/datamodel/property_types.py +6515 -0
  23. bam_masterdata-0.0.0/bam_masterdata/datamodel/vocabulary_types.py +81811 -0
  24. bam_masterdata-0.0.0/bam_masterdata/logger.py +41 -0
  25. bam_masterdata-0.0.0/bam_masterdata/metadata/__init__.py +0 -0
  26. bam_masterdata-0.0.0/bam_masterdata/metadata/definitions.py +442 -0
  27. bam_masterdata-0.0.0/bam_masterdata/metadata/entities.py +181 -0
  28. bam_masterdata-0.0.0/bam_masterdata/openbis/__init__.py +1 -0
  29. bam_masterdata-0.0.0/bam_masterdata/openbis/get_entities.py +181 -0
  30. bam_masterdata-0.0.0/bam_masterdata/openbis/login.py +18 -0
  31. bam_masterdata-0.0.0/bam_masterdata/utils/__init__.py +6 -0
  32. bam_masterdata-0.0.0/bam_masterdata/utils/utils.py +115 -0
  33. bam_masterdata-0.0.0/bam_masterdata.egg-info/PKG-INFO +176 -0
  34. bam_masterdata-0.0.0/bam_masterdata.egg-info/SOURCES.txt +78 -0
  35. bam_masterdata-0.0.0/bam_masterdata.egg-info/dependency_links.txt +1 -0
  36. bam_masterdata-0.0.0/bam_masterdata.egg-info/entry_points.txt +2 -0
  37. bam_masterdata-0.0.0/bam_masterdata.egg-info/requires.txt +24 -0
  38. bam_masterdata-0.0.0/bam_masterdata.egg-info/top_level.txt +2 -0
  39. bam_masterdata-0.0.0/docs/assets/datastore-logo-white.png +0 -0
  40. bam_masterdata-0.0.0/docs/assets/datastore-logo.png +0 -0
  41. bam_masterdata-0.0.0/docs/assets/drawio/masterdata-workflow.drawio +135 -0
  42. bam_masterdata-0.0.0/docs/assets/drawio/masterdata-workflow.drawio.png +0 -0
  43. bam_masterdata-0.0.0/docs/assets/fonts/BAMKlavika-Light.ttf +0 -0
  44. bam_masterdata-0.0.0/docs/assets/fonts/BAMKlavika-LightItalic.ttf +0 -0
  45. bam_masterdata-0.0.0/docs/assets/fonts/BAMKlavika-Medium.ttf +0 -0
  46. bam_masterdata-0.0.0/docs/assets/fonts/BAMKlavika-MediumItalic.ttf +0 -0
  47. bam_masterdata-0.0.0/docs/explanations/data-store.md +3 -0
  48. bam_masterdata-0.0.0/docs/explanations/openbis.md +3 -0
  49. bam_masterdata-0.0.0/docs/explanations/pybis.md +3 -0
  50. bam_masterdata-0.0.0/docs/howtos/overview.md +3 -0
  51. bam_masterdata-0.0.0/docs/howtos/pybis/collections.md +3 -0
  52. bam_masterdata-0.0.0/docs/howtos/pybis/datasets.md +3 -0
  53. bam_masterdata-0.0.0/docs/howtos/pybis/objects.md +3 -0
  54. bam_masterdata-0.0.0/docs/howtos/pybis/objects_props.md +3 -0
  55. bam_masterdata-0.0.0/docs/howtos/pybis/parent_child.md +3 -0
  56. bam_masterdata-0.0.0/docs/howtos/pybis/projects.md +3 -0
  57. bam_masterdata-0.0.0/docs/howtos/pybis/searches.md +3 -0
  58. bam_masterdata-0.0.0/docs/howtos/pybis/setup.md +3 -0
  59. bam_masterdata-0.0.0/docs/howtos/pybis/spaces.md +3 -0
  60. bam_masterdata-0.0.0/docs/index.md +55 -0
  61. bam_masterdata-0.0.0/docs/references/collection.md +3 -0
  62. bam_masterdata-0.0.0/docs/references/controlled-vocabulary.md +3 -0
  63. bam_masterdata-0.0.0/docs/references/dataset.md +3 -0
  64. bam_masterdata-0.0.0/docs/stylesheets/extra.css +166 -0
  65. bam_masterdata-0.0.0/docs/tutorials/create-masterdata.md +3 -0
  66. bam_masterdata-0.0.0/docs/tutorials/pybis.md +3 -0
  67. bam_masterdata-0.0.0/mkdocs.yml +78 -0
  68. bam_masterdata-0.0.0/pyproject.toml +146 -0
  69. bam_masterdata-0.0.0/scripts/install_python_dependencies.sh +30 -0
  70. bam_masterdata-0.0.0/scripts/pkg_size.py +25 -0
  71. bam_masterdata-0.0.0/setup.cfg +4 -0
  72. bam_masterdata-0.0.0/setup.py +3 -0
  73. bam_masterdata-0.0.0/tests/__init__.py +0 -0
  74. bam_masterdata-0.0.0/tests/cli/test_entities_to_excel.py +82 -0
  75. bam_masterdata-0.0.0/tests/cli/test_entities_to_json.py +42 -0
  76. bam_masterdata-0.0.0/tests/conftest.py +146 -0
  77. bam_masterdata-0.0.0/tests/metadata/test_definitions.py +288 -0
  78. bam_masterdata-0.0.0/tests/metadata/test_entities.py +54 -0
  79. bam_masterdata-0.0.0/tests/test_logger.py +37 -0
  80. bam_masterdata-0.0.0/tests/utils/test_utils.py +152 -0
@@ -0,0 +1,4 @@
1
+ [run]
2
+ omit =
3
+ bam_masterdata/_version.py
4
+ */__init__.py
@@ -0,0 +1,72 @@
1
+ name: Installing and Testing
2
+ on: [push]
3
+
4
+ # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
5
+ # `contents` is for permission to the contents of the repository.
6
+ # `pull-requests` is for permission to pull request
7
+ permissions:
8
+ contents: write
9
+ checks: write
10
+ pull-requests: write
11
+
12
+ env:
13
+ UV_SYSTEM_PYTHON: true
14
+
15
+ jobs:
16
+ install-and-test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ python_version: ["3.9", "3.10", "3.11", "3.12"]
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Python ${{matrix.python_version}}
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{matrix.python_version}}
28
+ - name: Install uv
29
+ run: |
30
+ curl -LsSf https://astral.sh/uv/install.sh | sh
31
+ - name: Install dependencies
32
+ run: |
33
+ pip install --upgrade pip
34
+ uv pip install -e '.[dev]'
35
+ - name: mypy
36
+ run: |
37
+ python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional --exclude dependencies bam_masterdata tests
38
+ - name: Test with pytest
39
+ run: |
40
+ python -m pytest -sv --ignore=bam_masterdata/dependencies tests
41
+ build-and-install:
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+ - name: Set up Python 3.12
46
+ uses: actions/setup-python@v5
47
+ with:
48
+ python-version: 3.12
49
+ - name: Install uv
50
+ run: |
51
+ curl -LsSf https://astral.sh/uv/install.sh | sh
52
+ - name: Build the package
53
+ run: |
54
+ uv pip install build
55
+ python -m build --sdist
56
+ - name: Install the package
57
+ run: |
58
+ uv pip install dist/*.tar.gz
59
+ ruff-linting:
60
+ runs-on: ubuntu-latest
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - uses: chartboost/ruff-action@v1
64
+ with:
65
+ args: "check . --exclude bam_masterdata/dependencies"
66
+ ruff-formatting:
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ - uses: chartboost/ruff-action@v1
71
+ with:
72
+ args: "format . --check --verbose --exclude bam_masterdata/dependencies"
@@ -0,0 +1,44 @@
1
+ name: Testing with coveralls Report
2
+ on: [push]
3
+
4
+ # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
5
+ # `contents` is for permission to the contents of the repository.
6
+ # `pull-requests` is for permission to pull request
7
+ permissions:
8
+ contents: write
9
+ checks: write
10
+ pull-requests: write
11
+
12
+ env:
13
+ UV_SYSTEM_PYTHON: true
14
+
15
+ jobs:
16
+ coveralls-test:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - name: Set up Python 3.12
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: 3.12
24
+ - name: Install uv
25
+ run: |
26
+ curl -LsSf https://astral.sh/uv/install.sh | sh
27
+ - name: Install dependencies
28
+ run: |
29
+ uv pip install -e '.[dev]'
30
+ uv pip install coveralls
31
+ - name: Build coverage file
32
+ run: |
33
+ pytest --cov-config=.coveragerc --junitxml=pytest.xml --cov=bam_masterdata tests | tee pytest-coverage.txt
34
+ - name: Pytest coverage comment
35
+ uses: MishaKav/pytest-coverage-comment@main
36
+ with:
37
+ pytest-coverage-path: pytest-coverage.txt
38
+ junitxml-path: pytest.xml
39
+ - name: Submit to coveralls
40
+ continue-on-error: true
41
+ env:
42
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43
+ run: |
44
+ coveralls --service=github
@@ -0,0 +1,29 @@
1
+ name: Deploy MkDocs Site
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main # Triggers deployment on push to the main branch
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ deploy:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout Repository
16
+ uses: actions/checkout@v4
17
+ - name: Set up Python 3.11
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: 3.11
21
+ - name: Install Documentation Dependencies
22
+ run: |
23
+ pip install --upgrade pip
24
+ pip install .[docu]
25
+ - name: Deploy docs
26
+ uses: mhausenblas/mkdocs-deploy-gh-pages@master
27
+ env:
28
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
+ CONFIG_FILE: mkdocs.yml
@@ -0,0 +1,43 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Build and Publish Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ env:
19
+ UV_SYSTEM_PYTHON: true
20
+
21
+ jobs:
22
+ deploy:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Set up Python 3.11
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: 3.11
30
+ - name: Install uv
31
+ run: |
32
+ curl -LsSf https://astral.sh/uv/install.sh | sh
33
+ - name: Install dependencies
34
+ run: |
35
+ pip install --upgrade pip
36
+ uv pip install build
37
+ - name: Build package
38
+ run: python -m build
39
+ - name: Publish package to PyPI
40
+ uses: pypa/gh-action-pypi-publish@release/v1
41
+ with:
42
+ user: __token__
43
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,177 @@
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
+ _version.py
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ coverage.txt
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ .pybuilder/
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ # For a library or package, you might want to ignore these files since the code is
89
+ # intended to run in multiple environments; otherwise, check them in:
90
+ # .python-version
91
+
92
+ # pipenv
93
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
95
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
96
+ # install all needed dependencies.
97
+ #Pipfile.lock
98
+
99
+ # poetry
100
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
101
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
102
+ # commonly ignored for libraries.
103
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
104
+ #poetry.lock
105
+
106
+ # pdm
107
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
108
+ #pdm.lock
109
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
110
+ # in version control.
111
+ # https://pdm.fming.dev/#use-with-ide
112
+ .pdm.toml
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ .pyenv
128
+ .testenv
129
+ env/
130
+ venv/
131
+ ENV/
132
+ env.bak/
133
+ venv.bak/
134
+
135
+ # Spyder project settings
136
+ .spyderproject
137
+ .spyproject
138
+
139
+ # Rope project settings
140
+ .ropeproject
141
+
142
+ # mkdocs documentation
143
+ /site
144
+
145
+ # mypy
146
+ .mypy_cache/
147
+ .dmypy.json
148
+ dmypy.json
149
+
150
+ # Pyre type checker
151
+ .pyre/
152
+
153
+ # pytype static type analyzer
154
+ .pytype/
155
+
156
+ # Cython debug symbols
157
+ cython_debug/
158
+
159
+ # PyCharm
160
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
163
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
+ #.idea/
165
+
166
+ # VSCode settings
167
+ .vscode/launch.json
168
+
169
+ # Ruff
170
+ .ruff_cache
171
+
172
+ # pytest coverage
173
+ pytest.xml
174
+ pytest-coverage.txt
175
+
176
+ # artifacts
177
+ artifacts
@@ -0,0 +1,3 @@
1
+ [submodule "bam_masterdata/dependencies/openbisschema"]
2
+ path = bam_masterdata/dependencies/openbisschema
3
+ url = https://git.bam.de/bam-data-store/development/openbisschema.git
@@ -0,0 +1,85 @@
1
+ {
2
+ "python.defaultInterpreterPath": "~/Miniconda3/python.exe",
3
+ "python.terminal.activateEnvInCurrentTerminal": true,
4
+ "editor.rulers": [90],
5
+ "editor.renderWhitespace": "all",
6
+ "editor.tabSize": 4,
7
+ "[javascript]": {
8
+ "editor.tabSize": 2
9
+ },
10
+ "files.trimTrailingWhitespace": true,
11
+ "files.watcherExclude": {
12
+ "${workspaceFolder}/.venv/**": true
13
+ },
14
+ "files.exclude": {
15
+ "\"**/*.pyc\": {\"when\": \"$(basename).py\"}": true,
16
+ "**/__pycache__": true,
17
+ "**/node_modules": true
18
+ },
19
+ "python.testing.pytestPath": "pytest",
20
+ "python.testing.pytestArgs": ["tests"],
21
+ "python.testing.unittestEnabled": false,
22
+ "editor.defaultFormatter": "charliermarsh.ruff",
23
+ "editor.formatOnSave": true,
24
+ "editor.codeActionsOnSave": {
25
+ "source.organizeImports.ruff": "always",
26
+ "source.fixAll.ruff": "always",
27
+ },
28
+ "launch": {
29
+ "version": "0.2.0",
30
+ "configurations": [
31
+ {
32
+ "name": "BM Python",
33
+ "type": "debugpy",
34
+ "request": "launch",
35
+ "console": "integratedTerminal",
36
+ "program": "${workspaceFolder}/bam_masterdata/metadata/entities.py", // path to your entry point Python module
37
+ },
38
+ {
39
+ "name": "BM tests",
40
+ "type": "debugpy",
41
+ "request": "launch",
42
+ "console": "integratedTerminal",
43
+ "program": "${workspaceFolder}/.venv/bin/pytest", // path to your virtual environment
44
+ "justMyCode": false,
45
+ "env": {
46
+ "_PYTEST_RAISE": "1"
47
+ },
48
+ "args": [
49
+ "-sv",
50
+ "${workspaceFolder}/tests/cli/test_cli.py" // path to your testing module
51
+ ]
52
+ },
53
+ {
54
+ "name": "BM fill-masterdata",
55
+ "type": "debugpy",
56
+ "request": "launch",
57
+ "cwd": "${workspaceFolder}",
58
+ "program": "${workspaceFolder}/.venv/bin/bam_masterdata",
59
+ "justMyCode": false,
60
+ "args": [
61
+ "fill_masterdata",
62
+ // "--url=https://devel.datastore.bam.de/"
63
+ ]
64
+ },
65
+ {
66
+ "name": "BM export-to-json",
67
+ "type": "debugpy",
68
+ "request": "launch",
69
+ "cwd": "${workspaceFolder}",
70
+ "program": "${workspaceFolder}/.venv/bin/bam_masterdata",
71
+ "justMyCode": false,
72
+ "args": ["export_to_json"]
73
+ },
74
+ {
75
+ "name": "BM export-to-excel",
76
+ "type": "debugpy",
77
+ "request": "launch",
78
+ "cwd": "${workspaceFolder}",
79
+ "program": "${workspaceFolder}/.venv/bin/bam_masterdata",
80
+ "justMyCode": false,
81
+ "args": ["export_to_excel"]
82
+ },
83
+ ]
84
+ },
85
+ }
@@ -0,0 +1,176 @@
1
+ Metadata-Version: 2.2
2
+ Name: bam-masterdata
3
+ Version: 0.0.0
4
+ Summary: The BAM Data Store utility tools and masterdata models wrapped in a Python package with a front-end web interface.
5
+ Author-email: BAM Data Store <datastore@bam.de>
6
+ Maintainer-email: "Jose M. Pizarro" <jose.pizarro-blanco@bam.de>
7
+ Project-URL: Homepage, https://github.com/BAMresearch/bam-masterdata
8
+ Project-URL: Bug Tracker, https://github.com/BAMresearch/bam-masterdata/issues
9
+ Classifier: Natural Language :: English
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: pybis~=1.37.1rc4
20
+ Requires-Dist: openpyxl
21
+ Requires-Dist: click
22
+ Requires-Dist: pydantic
23
+ Provides-Extra: dev
24
+ Requires-Dist: mypy==1.0.1; extra == "dev"
25
+ Requires-Dist: ruff; extra == "dev"
26
+ Requires-Dist: pytest; extra == "dev"
27
+ Requires-Dist: pytest-timeout; extra == "dev"
28
+ Requires-Dist: pytest-cov; extra == "dev"
29
+ Requires-Dist: python-decouple; extra == "dev"
30
+ Requires-Dist: structlog==24.4.0; extra == "dev"
31
+ Provides-Extra: jupy
32
+ Requires-Dist: jupyterlab; extra == "jupy"
33
+ Requires-Dist: notebook; extra == "jupy"
34
+ Requires-Dist: ipywidgets; extra == "jupy"
35
+ Provides-Extra: docu
36
+ Requires-Dist: mkdocs; extra == "docu"
37
+ Requires-Dist: mkdocs-material; extra == "docu"
38
+ Requires-Dist: pymdown-extensions; extra == "docu"
39
+ Requires-Dist: mkdocs-click; extra == "docu"
40
+
41
+ ![test-and-build pipeline](https://github.com/BAMresearch/bam-masterdata/actions/workflows/actions.yml/badge.svg)
42
+
43
+ # BAM Masterdata
44
+
45
+ The BAM Masterdata is a repository containing all the masterdata schema defining in BAM, as well as some utility functions to handle the masterdata.
46
+
47
+ <!--
48
+ ## Getting started
49
+
50
+ Add here installation instructions once the package is deployed -->
51
+
52
+ ## Development
53
+
54
+ If you want to develop locally this package, clone the project and enter in the workspace folder:
55
+
56
+ ```sh
57
+ git clone https://git.bam.de/bam-data-store/bam-masterdata.git
58
+ cd bam-masterdata
59
+ ```
60
+
61
+ Create a virtual environment (you can use Python>3.9) in your workspace:
62
+
63
+ ```sh
64
+ python3 -m venv .venv
65
+ source .venv/bin/activate
66
+ ```
67
+
68
+ Run the following script:
69
+
70
+ ```sh
71
+ ./scripts/install_python_dependencies
72
+ ```
73
+
74
+ ### Run the tests
75
+
76
+ You can locally run the tests by doing:
77
+
78
+ ```sh
79
+ python -m pytest -sv tests
80
+ ```
81
+
82
+ where the `-s` and `-v` options toggle the output verbosity.
83
+
84
+ You can also generate a local coverage report:
85
+
86
+ ```sh
87
+ python -m pytest --cov=src tests
88
+ ```
89
+
90
+ ### Run auto-formatting and linting
91
+
92
+ 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:
93
+
94
+ ```sh
95
+ ruff check .
96
+ ```
97
+
98
+ This will produce an output with the specific issues found. In order to auto-fix them, run:
99
+
100
+ ```sh
101
+ ruff format . --check
102
+ ```
103
+
104
+ If some issues are not possible to fix automatically, you will need to visit the file and fix them by hand.
105
+
106
+ ### Run the local website
107
+
108
+ **Under construction!**
109
+
110
+ <!-- ### Debugging
111
+
112
+ 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`:
113
+ ```json
114
+ {
115
+ "configurations": [
116
+ {
117
+ "name": "<descriptive tag>",
118
+ "type": "debugpy",
119
+ "request": "launch",
120
+ "cwd": "${workspaceFolder}",
121
+ "program": "${workspaceFolder}/.pyenv/bin/pytest",
122
+ "justMyCode": true,
123
+ "env": {
124
+ "_PYTEST_RAISE": "1"
125
+ },
126
+ "args": [
127
+ "-sv",
128
+ "--pdb",
129
+ "<path-to-plugin-tests>",
130
+ ]
131
+ }
132
+ ]
133
+ }
134
+ ```
135
+
136
+ where `<path-to-plugin-tests>` must be changed to the local path to the test module to be debugged.
137
+
138
+ The settings configuration file `.vscode/settings.json` automatically applies the linting and formatting upon saving the modified file. -->
139
+
140
+ ### Documentation on Github pages
141
+
142
+ To view the documentation locally, make sure to have installed the extra packages (this is part of the `scripts/install_python_dependencies.sh`, so if you ran this script before, you don't need to do it again now):
143
+
144
+ ```sh
145
+ uv pip install -e '[docu]'
146
+ ```
147
+
148
+ The first time, build the server:
149
+
150
+ ```sh
151
+ mkdocs build
152
+ ```
153
+
154
+ Run the documentation server:
155
+
156
+ ```sh
157
+ mkdocs serve
158
+ ```
159
+
160
+ The output looks like:
161
+
162
+ ```sh
163
+ INFO - Building documentation...
164
+ INFO - Cleaning site directory
165
+ INFO - [14:07:47] Watching paths for changes: 'docs', 'mkdocs.yml'
166
+ INFO - [14:07:47] Serving on http://127.0.0.1:8000/
167
+ ```
168
+
169
+ 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).
170
+
171
+ ## Main contributors
172
+
173
+ | Name | E-mail |
174
+ | ------------------- | ------------------------------------------------------------ |
175
+ | Carlos Madariaga | [carlos.madariaga@bam.de](mailto:carlos.madariaga@bam.de) |
176
+ | Dr. Jose M. Pizarro | [jose.pizarro-blanco@bam.de](mailto:jose.pizarro-blanco@bam.de) |