https://github.com/dasch-swiss/dsp-tools
A Python library and tools for the DSP-API
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 14 committers (7.1%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.2%) to scientific vocabulary
Keywords from Contributors
Repository
A Python library and tools for the DSP-API
Basic Info
- Host: GitHub
- Owner: dasch-swiss
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Homepage: https://docs.dasch.swiss/latest/DSP-TOOLS
- Size: 53.8 MB
Statistics
- Stars: 12
- Watchers: 9
- Forks: 5
- Open Issues: 4
- Releases: 0
Metadata Files
README.md
DSP-TOOLS - DaSCH Service Platform Tools
DSP-TOOLS is a command line tool that helps you to interact with the DaSCH Service Platform (DSP) API. This document is intended for developers who want to work with the code of DSP-TOOLS.
[!NOTE] This technical document was written as a guide for developers. For the end user documentation, please consult https://docs.dasch.swiss.
[!TIP] This README contains basic information for getting started. More details can be found in the developers' documentation.
Quick Start
To get started quickly, without reading the details, just execute these commands.
curl -LsSf https://astral.sh/uv/install.sh | shuv sync --all-extras --devsource .venv/bin/activatepre-commit installnpm install -g markdown-link-validatorbrew install just parallel yamlfmt
The remainder of this README explains these commands in more detail.
Using UV to manage Python installations, virtual environments, and dependencies
Curious what uv is and why we use it? Check out the respective section in the developers' documentation.
If you want to work on the code of DSP-TOOLS, you first have to do the following:
- Install uv with
curl -LsSf https://astral.sh/uv/install.sh | sh - Execute
uv sync --all-extras --dev, which will:- Install an appropriate Python version, if it doesn't find one on your machine.
- Create a virtual environment in the folder
.venv(if there isn't already one). - Install all dependencies (dev and non-dev) from
uv.lock. Ifuv.lockdoesn't exist, it installs the dependencies frompyproject.tomland creates a newuv.lock. - Make an editable installation of DSP-TOOLS inside the virtual environment.
There are two files defining the dependencies:
pyproject.tomllists the direct dependencies, ordered in two sections:[project.dependencies]lists the dependencies used to run the software.[tool.uv.dev-dependencies]lists the dependencies used for developing and testing.
uv.lockenables deterministic installations, by exactly pinning the versions of all (sub-)dependencies.
If you want to install a new package, install it with uv add package.
If your new package is only used in test code, use uv add --dev package instead.
This
- Installs the package (incl. sub-dependencies) in your virtual environment,
- Adds the package to the section
[project.dependencies]ofpyproject.toml, - Adds the pinned versions of the package and all sub-dependencies to
uv.lock.
If a package is only needed for development,
please install it with uv add --dev package,
so it will be added to the [tool.uv.dev-dependencies] section of pyproject.toml.
GitHub's dependabot is configured to automatically create a version bumping PR if there is an update for a dependency.
Version bumping PRs can also be created manually: run uv lock --upgrade and create a PR from the resulting changes.
All developers working with the DSP-TOOLS repository should regularly execute uv self update to update uv,
and uv sync --upgrade to update the dependencies from uv.lock.
Using the Virtual Environment
source .venv/bin/activate activates the virtual environment.
Set .venv/bin/python as the interpreter in your IDE,
so that your IDE automatically activates the virtual env if you open a new terminal.
The advantage of being in a virtual environment is that the command dsp-tools is available,
because uv sync installed an editable version of DSP-TOOLS inside the virtual environment.
This means, that inside the site-packages folder of your virtual environment,
there is a folder called dsp_tools-[version].dist-info,
which contains a link to your local clone of the DSP-TOOLS repository.
When you call dsp-tools from within the virtual environment, the code of your local clone will be executed.
Publishing and Distribution
Publishing is automated with GitHub Actions.
Please follow the
Pull Request Guidelines.
When merging a pull request into main, the release-please action will create or update a release PR.
This PR will follow semantic versioning and update the change log.
Once all desired features are merged, the release can be published by merging this release pull request into main.
This will trigger actions that create a release on GitHub and on PyPI.
Testing
The tests of this repository are partially written in the unittest framework, and partially in the pytest framework.
The following are self-contained and can be run without further requirements:
test/benchmarking: Prevent that the stashing algorithm of the xmlupload becomes worse.test/distribution: Make sure that the CLI entry point, all dependencies, and the resources are available on the end user's machine.test/unittests: Pure unit tests of lower-level functions.test/integration: Higher-level tests, with side effects like reading/writing operations on the file system.test/e2e: Tests interacting with a DSP-API instance, powered by test containers.
The following need a DSP stack running in the background.
A DSP stack can be started with the command
dsp-tools start-stack.
test/legacy-e2e
Tests can be run in three different ways:
- Run all tests in a given folder:
pytest test/unittests. - Run only the tests inside a single file:
pytest test/unittests/test_excel2xml.py. - Run only the test for a single method:
pytest test/unittests/test_excel2xml.py::TestExcel2xml::test_make_boolean_prop.
This is useful in combination with the debugging mode of your IDE if you want to examine why a single line of code in a test method fails.
Code Style
When contributing to the project, please make sure you use the same code style rules as we do. We use the following linters:
- mypy (configured in
pyproject.toml) - ruff (configured in
pyproject.toml) - darglint (configured in
.darglint) - markdown-link-validator (no configuration)
- MarkdownLint (configured in
.markdownlint.yml) - yamllint (configured in
.yamllint.yml) - yamlfmt (configured in
.yamlfmt.yml)
These linters are integrated in the GitHub CI pipeline, so that every pull request is checked for code style violations.
Your code can be checked for style violations locally before they are committed:
bash
just lint
Depending on your IDE, there are extensions that emit warnings:
VSCode
- MarkdownLint can be installed as an extension (
davidanson.vscode-markdownlint), and be configured in the VSCode settings. - mypy can be installed as an extension (
matangover.mypy), and be configured in the VSCode settings.- This extension is different from the mypy functionality of Microsoft's Python extension
ms-python.python, which only lints each file separately, leading to incomplete type checking.
- This extension is different from the mypy functionality of Microsoft's Python extension
- ruff can be installed as an extension (
charliermarsh.ruff), and be configured in the VSCode settings:settings.json>[python]>"editor.defaultFormatter": "charliermarsh.ruff"settings.json>"ruff.format.args": ["--line-length=120"]
If configured correctly, the style violations will be listed in the "Problems" tab.
Make sure to set the docstring format to "google-notypes" in the VSCode settings: VS Code > Settings > Auto Docstring: Docstring Format > google-notypes.
PyCharm
In PyCharm, mypy is available as plugin, and many style checks can be enabled in Settings > Editor > Inspections > Python.
Make sure to set the docstring format to "Google notypes" in the PyCharm settings: PyCharm > Settings > Tools > Python Integrated Tools > Docstring format: Google notypes
mypy
The just command just mypy uses the dmypy daemon,
which is a background process that holds a cache of type information about the code.
The advantage is that subsequent runs of just mypy are much faster.
The disadvantage is that in rare cases,
the cache can be outdated or broken so that dmypy reports a wrong result.
If just mypy behaves weirdly, you can restart the daemon with dmypy restart.
Pre-Commit Hooks
We use pre-commit hooks, which are configured in .pre-commit-config.yaml.
If you try to make a commit, the pre-commit hooks will be executed before the commit is created.
If a hook fails, the commit will be aborted and the Git output will list the problems in your code.
If a hook modifies a file, the commit will be aborted. You can then stage the changes made by the hook, and commit again.
Pre-commit is contained in the dependencies,
but before the first use, the hooks must be installed with pre-commit install.
Contributing to the Documentation
The documentation is a collection of Markdown files in the docs folder.
They are converted to HTML with MkDocs.
We are gradually switching to Semantic Line Breaks,
so don't be confused to see unexpected line breaks.
The navigation bar and other configurations can be configured in the mkdocs.yml file.
After modifying the documentation, build and check the result with the following command:
bash
mkdocs serve
This allows you to look at a preview of the documentation in a browser.
Please note that this is not the final form in which the documentation will be published.
Rather, they are published together with the docs of DSP-API and DSP-APP on https://docs.dasch.swiss/
by embedding all three repositories as git submodules
into the central dsp-docs repository.
If conflicting, the configurations of dsp-docs will override the configurations of the dsp-tools repository.
In rare cases, a certain syntax may be correctly rendered locally,
but not on https://docs.dasch.swiss/latest/DSP-TOOLS.
In order to keep this difference minimal,
mkdocs.yml of dsp-tools should be as close as possible to the mkdocs.yml of dsp-docs.
During the centralized deployment process of all components of the DSP software stack, the docs of dsp-tools get built from the latest release tag to https://docs.dasch.swiss/latest/DSP-TOOLS.
This means that in order to modify the contents of https://docs.dasch.swiss/latest/DSP-TOOLS, it is necessary to:
- Merge the modifications into the main branch of the dsp-tools repository,
- Release DSP-TOOLS.
Owner
- Name: DaSCH - Swiss National Data and Service Center for the Humanities
- Login: dasch-swiss
- Kind: organization
- Email: info@dasch.swiss
- Location: Switzerland
- Website: https://dasch.swiss
- Twitter: DaSCHSwiss
- Repositories: 35
- Profile: https://github.com/dasch-swiss
Development repositories of the DaSCH.
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 374
- Total Committers: 14
- Avg Commits per committer: 26.714
- Development Distribution Score (DDS): 0.642
Top Committers
| Name | Commits | |
|---|---|---|
| Johannes Nussbaum | 3****m@u****m | 134 |
| Lukas Rosenthaler | l****r@u****h | 70 |
| DaSCH Bot | 5****t@u****m | 52 |
| irinaschubert | i****t@d****s | 44 |
| Ivan Subotic | i****s@s****h | 29 |
| Ivan Subotic | 4****c@u****m | 22 |
| Balduin Landolt | 3****t@u****m | 8 |
| Vijeinath Tissaveerasingham | v****h@g****h | 5 |
| Gregor Bachmann | 9****b@u****m | 4 |
| dependabot[bot] | 4****]@u****m | 2 |
| Loïc Jaouen | l****n@u****h | 1 |
| Marion Rivoal | m****l@u****h | 1 |
| danielasubotic | 4****c@u****m | 1 |
| Tobias Schweizer | t****r@u****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 8
- Total pull requests: 2,471
- Average time to close issues: 7 days
- Average time to close pull requests: 2 days
- Total issue authors: 3
- Total pull request authors: 16
- Average comments per issue: 1.38
- Average comments per pull request: 0.67
- Merged pull requests: 2,012
- Bot issues: 0
- Bot pull requests: 87
Past Year
- Issues: 6
- Pull requests: 1,245
- Average time to close issues: 10 days
- Average time to close pull requests: 1 day
- Issue authors: 3
- Pull request authors: 11
- Average comments per issue: 1.33
- Average comments per pull request: 0.51
- Merged pull requests: 991
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- jnussbaum (4)
- Nora-Olivia-Ammann (3)
- rfbaumgartner (1)
Pull Request Authors
- Nora-Olivia-Ammann (1,161)
- jnussbaum (1,010)
- daschbot (107)
- dependabot[bot] (72)
- BalduinLandolt (51)
- github-actions[bot] (15)
- seakayone (15)
- irmastnt (11)
- gNahcab (8)
- siers (7)
- rfbaumgartner (4)
- derschnee68 (3)
- Notheturtle (2)
- mpro7 (2)
- SamuelBoerlin (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 3,869 last-month
- Total dependent packages: 0
- Total dependent repositories: 2
- Total versions: 520
- Total maintainers: 3
pypi.org: dsp-tools
DSP-TOOLS is a Python package with a command line interface that helps you interact with a DaSCH service platform (DSP) server.
- Homepage: https://www.dasch.swiss/
- Documentation: https://docs.dasch.swiss/latest/DSP-TOOLS/
- License: GNU General Public License v3 (GPLv3)
-
Latest release: 16.10.0
published 10 months ago
Rankings
Dependencies
- actions/checkout v3 composite
- shundor/python-bandit-scan main composite
- deepakputhraya/action-pr-title master composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- lakto/google-chat-action main composite
- google-github-actions/release-please-action v3 composite
- FedericoCarboni/setup-ffmpeg v2 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- mfinelli/setup-imagemagick v2 composite
- daschswiss/knora-api latest
- daschswiss/apache-jena-fuseki 2.1.1
- daschswiss/dsp-app v10.23.4
- daschswiss/knora-api v30.2.1
- daschswiss/knora-sipi v30.2.1
- argparse 1.4.0
- astroid 2.15.6
- attrs 23.1.0
- babel 2.12.1
- beautifulsoup4 4.12.2
- black 23.7.0
- certifi 2023.7.22
- cfgv 3.4.0
- charset-normalizer 3.2.0
- click 8.1.6
- colorama 0.4.6
- cssselect 1.2.0
- darglint 1.8.1
- decorator 5.1.1
- defusedxml 0.7.1
- dill 0.3.7
- distlib 0.3.7
- docker 6.1.3
- et-xmlfile 1.1.0
- filelock 3.12.2
- ghp-import 2.1.0
- identify 2.5.26
- idna 3.4
- iniconfig 2.0.0
- isort 5.12.0
- jinja2 3.1.2
- jsonpath-ng 1.5.3
- jsonschema 4.19.0
- jsonschema-specifications 2023.7.1
- lazy-object-proxy 1.9.0
- lxml 4.9.3
- markdown 3.4.4
- markdown2 2.4.10
- markupsafe 2.1.3
- mccabe 0.7.0
- mergedeep 1.3.4
- mkdocs 1.5.2
- mkdocs-include-markdown-plugin 3.9.1
- mkdocs-material 9.2.6
- mkdocs-material-extensions 1.1.1
- mypy 1.5.1
- mypy-extensions 1.0.0
- networkx 3.1
- nodeenv 1.8.0
- numpy 1.25.2
- odfpy 1.4.1
- openpyxl 3.1.2
- packaging 23.1
- paginate 0.5.6
- pandas 2.1.0
- pathspec 0.11.2
- platformdirs 3.10.0
- pluggy 1.2.0
- ply 3.11
- pre-commit 3.3.3
- pygments 2.16.1
- pylint 2.17.5
- pymdown-extensions 10.1
- pyquery 2.0.0
- pytest 7.4.0
- python-dateutil 2.8.2
- pytz 2023.3
- pywin32 306
- pyxlsb 1.0.10
- pyyaml 6.0.1
- pyyaml-env-tag 0.1
- readtime 3.0.0
- referencing 0.30.2
- regex 2023.8.8
- requests 2.31.0
- rpds-py 0.9.2
- setuptools 68.0.0
- six 1.16.0
- soupsieve 2.4.1
- tomlkit 0.12.1
- types-beautifulsoup4 4.12.0.6
- types-html5lib 1.1.11.15
- types-jsonschema 4.17.0.10
- types-lxml 2023.3.28
- types-openpyxl 3.1.0.17
- types-pyyaml 6.0.12.11
- types-regex 2023.8.8.0
- types-requests 2.31.0.2
- types-urllib3 1.26.25.14
- typing-extensions 4.7.1
- tzdata 2023.3
- urllib3 2.0.4
- virtualenv 20.24.3
- watchdog 3.0.0
- websocket-client 1.6.1
- wrapt 1.15.0
- xlrd 2.0.1
- xlsxwriter 3.1.2
- argparse ^1.4.0
- docker ^6.1.3
- jsonpath-ng ^1.5.3
- jsonschema ^4.19.0
- lxml ^4.9.3
- networkx ^3.1
- openpyxl ^3.1.2
- pandas ^2.0.3
- python ^3.11
- pyyaml ^6.0.1
- regex ^2023.8.8
- requests ^2.31.0
- actions/checkout v3 composite
- actions/setup-python v4 composite
- sourcery-ai/action v1 composite