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.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-03 11:26:46 +01:00
.github ci: trust organisation-owned actions in CodeQL Actions analysis 2026-12-03 11:26:46 +01:00
docs feat: migrate from poetry to uv (#152) 2026-02-23 09:03:47 +01:00
python_requirements_inspector test: address the review points left open when the path validation merged (#179) 2026-08-19 09:36:58 +02:00
tests test: address the review points left open when the path validation merged (#179) 2026-08-19 09:36:58 +02:00
.gitignore chore(deps): adjust dependencies for Renovate compatibility (#119) 2025-07-08 16:17:40 +02:00
.pre-commit-config.yaml chore(deps): update pre-commit hook commitizen-tools/commitizen to v4.20.1 2026-11-27 12:22:35 +00:00
.release-please-manifest.json chore(main): release 4.3.0 (#182) 2026-10-28 08:45:40 +01:00
.tool-versions feat: add python 3.14 support, bump uv to 0.13.4 (#185) 2026-10-22 12:02:46 +02:00
.yamlfix.toml
CHANGELOG.md chore(main): release 4.3.0 (#182) 2026-10-28 08:45:40 +01:00
CLAUDE.md feat: add python 3.14 support, bump uv to 0.13.4 (#185) 2026-10-22 12:02:46 +02:00
CODING_STANDARDS.md docs: sync documentation from template (#173) 2026-08-18 15:04:18 +02:00
CONTRIBUTING.md docs: sync documentation from template (#173) 2026-08-18 15:04:18 +02:00
DCO chore: sync licensing and linting configuration from template (#171) 2026-08-10 22:36:36 +02:00
LICENSE chore: sync licensing and linting configuration from template (#171) 2026-08-10 22:36:36 +02:00
NOTICE chore: sync licensing and linting configuration from template (#171) 2026-08-10 22:36:36 +02:00
pyproject.toml fix(deps): update dependency coverage to v7.18.0 2026-12-02 23:09:09 +00:00
README.md feat: add python 3.14 support, bump uv to 0.13.4 (#185) 2026-10-22 12:02:46 +02:00
release-please-config.json fix: add root package to release-please config 2026-02-23 10:49:29 +01:00
RELEASE.md feat: migrate from poetry to uv (#152) 2026-02-23 09:03:47 +01:00
renovate.json chore: keep python below 3.15 for spacy (#186) 2026-10-22 14:02:44 +02:00
sonar-project.properties feat: add python 3.14 support, bump uv to 0.13.4 (#185) 2026-10-22 12:02:46 +02:00
tox.ini feat: add python 3.14 support, bump uv to 0.13.4 (#185) 2026-10-22 12:02:46 +02:00
uv.lock fix(deps): update dependency coverage to v7.18.0 2026-12-02 23:09:09 +00:00
zizmor.yml chore: complete the template synchronisation (#177) 2026-08-18 20:38:23 +02:00

Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Reliability Rating Security Rating Maintainability Rating Vulnerabilities

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
  }
]