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.reqifmás sus adjuntos). Extrae a un directorio de trabajo, expone cada.reqifcomo unReqif, 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29f1e03cf9bff89b7b0e00fc5eaa9c447ecae4dc65bca5c615d6edb8c913348b
|
|
| MD5 |
670fd1c351087c36712825f3d7ee8c53
|
|
| BLAKE2b-256 |
9fe7b09775d3c791c97c19bbf9d9b415f3a2fd9f359ed5e29e48f21a3a4a5167
|
Provenance
The following attestation bundles were made for pyreqifz-0.1.0.tar.gz:
Publisher:
publish.yml on ErnestoAvedillo/pyreqif
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyreqifz-0.1.0.tar.gz -
Subject digest:
29f1e03cf9bff89b7b0e00fc5eaa9c447ecae4dc65bca5c615d6edb8c913348b - Sigstore transparency entry: 2810891365
- Sigstore integration time:
-
Permalink:
ErnestoAvedillo/pyreqif@396f44d2a54931cac37701e8ea64a7ab2dadc3cc -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/ErnestoAvedillo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@396f44d2a54931cac37701e8ea64a7ab2dadc3cc -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
687aeb99e707911dfcb718ada6b0fdc3ae5c34d59480d1c246118aeceee7b864
|
|
| MD5 |
a3c8e71ff638ee032a6e027e182339f3
|
|
| BLAKE2b-256 |
861fcf917c710291e7cf9ac5d81e05da0ca2736cb04c34462d419dacda0daa7f
|
Provenance
The following attestation bundles were made for pyreqifz-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ErnestoAvedillo/pyreqif
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyreqifz-0.1.0-py3-none-any.whl -
Subject digest:
687aeb99e707911dfcb718ada6b0fdc3ae5c34d59480d1c246118aeceee7b864 - Sigstore transparency entry: 2810891427
- Sigstore integration time:
-
Permalink:
ErnestoAvedillo/pyreqif@396f44d2a54931cac37701e8ea64a7ab2dadc3cc -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/ErnestoAvedillo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@396f44d2a54931cac37701e8ea64a7ab2dadc3cc -
Trigger Event:
release
-
Statement type: