Skip to content

SchweizerischeBundesbahnen/python-requirements-inspector

Repository files navigation

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

How to test and build

This module can be produced using poetry:

poetry install
poetry run pre-commit run -a
poetry run tox
poetry build

How to install

Poetry project

poetry add https://github.com/SchweizerischeBundesbahnen/python-requirements-inspector/releases/download/4.0.0/python_requirements_inspector-4.0.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

poetry run inspect-requirements path/to/input/json

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

About

Python module to inspect any type of functional or non-functional requirements

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages