Skip to main content

Main PyPI version

Home page | Getting started

nydok is a combined specification writing and testing framework, for producing consistent and traceable specification documents. It is developed for Computerized Systems Validation in a GAMP 5 / GxP context, but is applicable to any software development process where traceability is important.

Write your requirements and risk assessment alongside your Python code, ensuring 1:1 mapping between requirements and the code you're writing.

It is implemented as a plugin for pytest for running the tests, combined with a CLI for creating reports.

Features

Some notable features are:

  • Lets you write specification documents including requirements as normal Markdown.
  • Keeps track of which requirements are missing test cases.
  • Supports a risk assessment process where you can link mitigations to your requirements.
  • Can generate several types of reports in Markdown format for use in a Computerized System Validation process, such as:
    • Traceability matrix
    • Code review reports (Gitlab)
    • Risk assessment report
    • Test summary report
    • CI pipeline logs report (Gitlab)

Installation

Note! nydok is still under development and hasn't yet had a v1.0.0 release, so expect breaking changes.

To install nydok using pip:

pip install nydok

or using Poetry:

poetry add nydok --group dev

Usage

See documentation for details on how to use nydok, the following is just meant as a quick glimpse of how it works. nydok has a lot more features than what is shown here.

Create a cowsay.spec.md specification file:

# Cowsay functional specification

## Functional requirements

- REQ001: The program must take as input a text string
- REQ002: The program must return a string with a cow in ASCII art, displaying the input text as a speech bubble

and a test_cowsay.py file:

from nydok import testcase
import cowsay


@testcase(["REQ001", "REQ002"])
def test_cowsay():
    assert cowsay("Hello world") == """
     _____________
    < Hello world >
     -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
    """

Next, run pytest to check the specification:

$ pytest --nydok-output nydok.json cowsay/
========================= test session starts =========================
platform linux -- Python 3.14.7, pytest-9.2.0, pluggy-1.7.0
rootdir: /project
plugins: nydok-1.0.0
collected 3 items

cowsay/test_cowsay.py::test_cowsay PASSED                       [ 33%]
cowsay/cowsay.spec.md::REQ001 PASSED                            [ 66%]
cowsay/cowsay.spec.md::REQ002 PASSED                            [100%]

========================== 3 passed in 0.01s ==========================

Each requirement listed in the specification file is counted as a test item, and will pass or fail depending on it's test case.

Finally, run nydok report to generate reports.

As an example, to create a traceability matrix, run:

$ nydok report traceability-matrix nydok.json

to generate the following Markdown table:

ID Description References Test case
REQ001 The program must take as input a text string TC001
REQ002 The program must return a string with a cow in ASCII art, displaying the input text as a speech bubble TC001

License

nydok is released under the MIT license. See LICENSE for details.

Metadata

Release files for nydok 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nydok 1.0.0
File Size Uploaded Provenance Actions
nydok-1.0.0.tar.gz 21.3 kB With provenance Details for nydok-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nydok 1.0.0
File Interpreter ABI Platform Actions
nydok-1.0.0-py3-none-any.whl Python 3 none any Details for nydok-1.0.0-py3-none-any.whl

Total release size: 47.5 kB

Release files / nydok-1.0.0.tar.gz

Download URL nydok-1.0.0.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a4be2d9be60be36d1c1ac134b8c094760b8976f0bce80e4f2098ee84d661db3c
BLAKE2b-256 checksum
How to use checksums
d182f979cf067a4d18ecacf52ef0d0f0f190da253269f54e2b083634dc61869a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / nydok-1.0.0-py3-none-any.whl

Download URL nydok-1.0.0-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a94d1b5a9126f9760258a24f74d8975e22032a878b1792d5ccc22fcb4bda1295
BLAKE2b-256 checksum
How to use checksums
c4e8f89089757f0cb3333d42b23732d17146e922e029c961e3d9b490d83ac7bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for nydok 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nydok-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page