Skip to main content

pyreqif

Python library to read, edit, and repackage ReqIF documents (.reqif / .reqifz), the OMG standard commonly used to exchange requirements between manufacturer and supplier (e.g. automotive lastenheft). This version is prepared per defect for reqif from VW. In case you have another OEM file please contact me.

Two classes:

  • Reqif: a single .reqif file. Reads each requirement (SPEC-OBJECT) with its text, and two configurable fields designed for the supplier workflow: comment (Kommentar Lieferant M, XHTML) and status (Status Lieferant M, enumerated). Allows editing them, exporting/importing via Excel (with a validation dropdown for the status, and images embedded in the cell if a resolver is provided), and detects images embedded in each requirement's text.
  • Reqifz: a .reqifz (a zip with one or more .reqif files plus their attachments). Extracts to a working directory, exposes each .reqif as a Reqif, and repackages everything back while keeping the attachments intact.

Installation

pip install pyreqifz

(the package name on PyPI is pyreqifzpyreqif was already taken — but the module is still imported as pyreqif.)

Basic usage

from pyreqif import Reqifz

with Reqifz("lastenheft.reqifz") as pack:
    for doc in pack:
        print(doc, "->", len(doc), "requirements")

    doc = pack.get(0)  # or pack.get("file_name.reqif")

    # read
    req = doc.get("_a1b2c3...")
    print(req.text, req.comment, req.status, req.images)

    # edit (None leaves the field unchanged, "" clears it)
    doc.update("_a1b2c3...", comment="Accepted, no changes.", status="akzeptiert")

    # export to Excel, with the first image of each requirement
    # embedded in its cell ("Image" column)
    doc.to_excel("requirements.xlsx", image_resolver=pack.image_path)

    # import back (only touches comment and status)
    doc.update_from_excel("requirements_reviewed.xlsx")

    # repackage with the changes
    pack.save("lastenheft_edited.reqifz")

A standalone (uncompressed) .reqif is used the same way, without going through Reqifz (but then to_excel() can't embed images, since it doesn't know where the attachments are — pass your own image_resolver if you have them elsewhere):

from pyreqif import Reqif

doc = Reqif("document.reqif")
doc.update("_a1b2c3...", status="Klärungsbedarf")
doc.save("document_edited.reqif")

Attribute names

By default, the standard ReqIF names are used for the text (ReqIF.Text / ReqIF.ChapterName as fallback) and the field names for this specific supplier workflow (Kommentar Lieferant M / Status Lieferant M). If your document uses other names, create a subclass:

from pyreqif import Reqif

class MyReqif(Reqif):
    COMMENT_ATTR = "Supplier Comment"
    STATUS_ATTR = "Supplier Status"

Development

uv venv
uv pip install -e ".[dev]"
uv run pytest

GitHub

https://github.com/ErnestoAvedillo/pyreqif

Contact

Ernesto Avedillo Carretero — eavedillo@yahoo.es

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyreqifz-0.1.2.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyreqifz-0.1.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file pyreqifz-0.1.2.tar.gz.

File metadata

  • Download URL: pyreqifz-0.1.2.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.12

File hashes

Hashes for pyreqifz-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e38da075416c9d21657be026c1bb455f3f624b5adb7e023be0ed0a0d482ac255
MD5 eec386611476e4a17732a1270d57afd0
BLAKE2b-256 600dd268582c5bf79b8d3a2a27ec8da1e5d5b1ef0c86bba5aaf156c511ab7d8a

See more details on using hashes here.

File details

Details for the file pyreqifz-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyreqifz-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.12

File hashes

Hashes for pyreqifz-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2ab073c31e6af0fa73e5439ce7f8fb21bf4c192eccade18ccd9ef88a56844f3c
MD5 6914c9dae822686412190d3ec6f09afb
BLAKE2b-256 ab6c156efb9822a5128cf63352648072bc1c1a0dcdff81fd807d0af690e57a52

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

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