Skip to main content

pyreqif

Librería Python para leer, editar y reempaquetar documentos ReqIF (.reqif / .reqifz), el estándar OMG usado habitualmente para intercambiar requisitos entre fabricante y proveedor (p.ej. lastenheft de automoción).

Dos clases:

  • Reqif: un único fichero .reqif. Lee cada requisito (SPEC-OBJECT) con su texto, y dos campos configurables pensados para el flujo proveedor: comentario (Kommentar Lieferant M, XHTML) y estado (Status Lieferant M, enumerado). Permite editarlos, exportar/importar por Excel (con desplegable de validación para el estado) y detecta las imágenes embebidas en el texto de cada requisito.
  • Reqifz: un .reqifz (zip con uno o varios .reqif más sus adjuntos). Extrae a un directorio de trabajo, expone cada .reqif como un Reqif, y reempaqueta todo de vuelta conservando los adjuntos intactos.

Instalación

pip install pyreqif

Uso básico

from pyreqif import Reqifz

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

    doc = pack.get(0)  # o pack.get("nombre_del_fichero.reqif")

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

    # editar (None deja el campo igual, "" lo vacía)
    doc.update("_a1b2c3...", comment="Aceptado, sin cambios.", status="akzeptiert")

    # exportar/importar por Excel
    doc.to_excel("requisitos.xlsx")
    doc.update_from_excel("requisitos_revisado.xlsx")

    # volver a empaquetar con los cambios
    pack.save("lastenheft_editado.reqifz")

Un .reqif suelto (sin comprimir) se usa igual, sin pasar por Reqifz:

from pyreqif import Reqif

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

Nombres de atributo

Por defecto se usan los nombres estándar de ReqIF para el texto (ReqIF.Text / ReqIF.ChapterName como respaldo) y los nombres de campo de este flujo concreto de proveedor (Kommentar Lieferant M / Status Lieferant M). Si tu documento usa otros nombres, crea una subclase:

from pyreqif import Reqif

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

Desarrollo

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

Licencia

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.0.tar.gz (11.1 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.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyreqifz-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyreqifz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29f1e03cf9bff89b7b0e00fc5eaa9c447ecae4dc65bca5c615d6edb8c913348b
MD5 670fd1c351087c36712825f3d7ee8c53
BLAKE2b-256 9fe7b09775d3c791c97c19bbf9d9b415f3a2fd9f359ed5e29e48f21a3a4a5167

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreqifz-0.1.0.tar.gz:

Publisher: publish.yml on ErnestoAvedillo/pyreqif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pyreqifz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyreqifz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 687aeb99e707911dfcb718ada6b0fdc3ae5c34d59480d1c246118aeceee7b864
MD5 a3c8e71ff638ee032a6e027e182339f3
BLAKE2b-256 861fcf917c710291e7cf9ac5d81e05da0ca2736cb04c34462d419dacda0daa7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreqifz-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ErnestoAvedillo/pyreqif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

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