mirror of
https://github.com/SchweizerischeBundesbahnen/python-requirements-inspector.git
synced 2026-12-04 16:18:40 +00:00
Python module to inspect any type of functional or non-functional requirements | Read-only mirror of https://github.com/SchweizerischeBundesbahnen/python-requirements-inspector — SBB. Issues & pull requests at the source.
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github | ||
| docs | ||
| python_requirements_inspector | ||
| tests | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .release-please-manifest.json | ||
| .tool-versions | ||
| .yamlfix.toml | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| CODING_STANDARDS.md | ||
| CONTRIBUTING.md | ||
| DCO | ||
| LICENSE | ||
| NOTICE | ||
| pyproject.toml | ||
| README.md | ||
| release-please-config.json | ||
| RELEASE.md | ||
| renovate.json | ||
| sonar-project.properties | ||
| tox.ini | ||
| uv.lock | ||
| zizmor.yml | ||
Python module to inspect any type of functional or non-functional requirements
This module uses spaCy v3.8.7 to inspect requirements written in English or German. For each requirement a report will be generated with information about the complexity, usage of weak words, usage of non-passive sentences, etc
Prerequisites
This project requires Python 3.13 or 3.14 and uv for dependency management.
Setup Environment
# Install dependencies (including test dependencies)
uv sync --all-groups
How to test and build
This module can be produced using uv:
uv run pre-commit run -a
uv run tox
uv build
How to install
UV project
uv add https://github.com/SchweizerischeBundesbahnen/python-requirements-inspector/releases/download/4.1.0/python_requirements_inspector-4.1.0-py3-none-any.whl
How to use (example)
Inputs are defined in inputs.json
[
{
"id": "requirements1",
"title": "I'm a title without a processword",
"description":"I'm a description for testing with a weakword accordingly",
"language":"en"
},
{
"id": "requirements2",
"title": "Ich bin ein Titel ohne Processwort",
"description":"öüäß Ich bin eine Beschreibung mit dem Weakword entsprechend und Umlauts.",
"language":"de"
}
]
Execute
uv run inspect-requirements path/to/input/json
The main function only accepts input JSON inside the current working directory.
For use in automated processes, import WorkitemAnalyzer directly instead.
Outputs will be returned in /tmp/output_*.json
[
{"id": "requirements1",
"language": "en",
"smellDescription": "In TITLE missingProcessword: Title contains no process word\nIn DESCRIPTION Sentence 1 I'm a\u2026 smellWeakword: accordingly [9] \n",
"smellComplex": 0,
"smellPassive": 0,
"smellWeakword": 1,
"smellComparative": 0,
"missingProcessword": true
},
{
"id": "requirements2",
"language": "de",
"smellDescription": "In TITLE missingProcessword: Title contains no process word\nIn DESCRIPTION Sentence 1 \u00f6\u00fc\u00e4\u00df Ich bin\u2026 smellWeakword: entsprechend [8] \n",
"smellComplex": 0,
"smellPassive": 0,
"smellWeakword": 1,
"smellComparative": 0,
"missingProcessword": true
}
]