Skip to main content

xactflow-component

A XactFlow exporter plugin that serializes an ipxact.Component object into a valid IEEE 1685-2022 IP-XACT component XML document.

ipxact-compiler reads IP-XACT XML and hands back Python objects, it never writes XML. This package is the other direction: given a Component, it writes the XML back out.

Installation

pip install xactflow-component

For local development, requirements-dev.txt overrides ipxact-compiler and xactflow to local installations. It can be modified to adapt the paths or to keep either version on PyPI.

pip install -r requirements-dev.txt -e .

Requires Python >= 3.9.

Usage

from pathlib import Path

import ipxact
from xactflow_component import ComponentExporter

component = ipxact.parse_file("apb_uart.xml")   # or get one from an importer
ComponentExporter().export(component, Path("out"))
# writes out/<vendor>_<library>_<name>_<version>.xml

The output file is named after the component's full VLNV (<vendor>_<library>_<name>_<version>.xml) inside output_dir, which is created if it does not exist. Each VLNV part may only hold letters, digits, ., _ and -; anything else raises ValueError. Exporting the same component again replaces its file, but a file of that name holding anything else (another VLNV, or not a component) raises FileExistsError.

Lower-level entry points are available for callers that want the tree or the bytes rather than a file:

from xactflow_component import component_to_bytes, write_component, write_component_file

element = write_component(component)              # the lxml ipxact:component root element
data = component_to_bytes(component)              # pretty-printed bytes, with an XML declaration
path = write_component_file(component, "out.xml") # writes and returns the path

Once installed, the exporter registers itself under the xactflow.exporters entry point group as component. From the XactFlow CLI, use it after an importer with --then component:

xactflow sv uart.sv --option metadata=uart_ipxact.json --then component --output out/
# writes out/<vendor>_<library>_uart_<version>.xml

The xactflow component <design> subcommand links a design first and passes the result to the exporter, so it fails until LinkedDesign is supported (see below).

export() raises TypeError for anything that is not an ipxact.Component. Accepting a LinkedDesign (flattening a resolved multi-instance design into one boundary component) is a planned later addition, not an oversight.

Design notes

  • Element order comes from the XSD, not from the dataclasses. componentType's sequence puts displayName/shortDescription/description right after the VLNV and typeDefinitions/ powerDomains before busInterfaces, while the Component dataclass declares those fields last. The same mismatch repeats in almost every nested type, because IP-XACT's nameGroup opens an element while the corresponding Python fields are trailing optionals. Every writer here follows the schema.
  • Expressions are written verbatim. Anything typed Expression in ipxact-compiler (addressOffset, size, range, width, bitOffset, bitWidth, ...) keeps its raw text in .value, which is emitted unchanged, never evaluated or reformatted, together with its minimum/maximum, xml:id and attributes from other namespaces.
  • Vendor extensions stay identical. Their content is not IP-XACT's to define, so each fragment is re-inserted as parsed (only a leading XML declaration is dropped).
  • Defaults are omitted. Attributes and elements whose value equals the schema default (resolve="immediate", type="string", misalignmentAllowed="true", connectionRequired false, and so on) are left out, which keeps the output close to hand-written IP-XACT and still round-trips exactly.
  • XSD choices raise ValueError when no arm or more than one arm is set, instead of emitting invalid XML or losing data. Several dataclasses share one field across XSD contexts with different required-ness, expose independent sibling fields that the schema only allows together, or expose each arm of a choice (wire/transactional/structured, a *DefinitionRef and the content it replaces, ...) as its own field. Rather than silently writing an incomplete element, or writing one arm and dropping the others, the writer raises a specific error naming the fields involved. The same goes for a field set where the schema has no place for it, such as a base_address on a block inside a bank.

Known gaps

Since ipxact-compiler 0.2.0, its object model covers the whole IEEE 1685-2022 component schema, and this writer writes every part of it, *DefinitionRef references included (they are written as references, not resolved). One gap is left:

  • externalTypeDefinitions has an optional name. The schema's nameGroup requires one.

The writer also does not invent content the object model leaves out, so a Component that is under-specified relative to the schema produces XML that says so: a register with no fields, a memoryRemap with no modeRef, a channel with fewer than two busInterfaceRefs, a file with no fileType, or a componentGenerator with more than one transportMethod will each fail validation rather than being silently patched up. ipxact.validate() checks the output against the XSD shipped with ipxact-compiler, and is the way to catch that.

Development

pip install -r requirements-dev.txt -e .
pytest

The tests round-trip hand-built components through the writer and back through the parser, validate the written XML against the component.xsd shipped with ipxact-compiler, and re-run xactflow.SCR.run_single_doc_checks on the result. Between them, the hand-built components set every field of every dataclass a Component can contain, and a test fails when one is not set, so a field added to ipxact-compiler cannot be missed by the writer unnoticed.

License

LGPL-3.0. See LICENSE.

Metadata

Release files for xactflow-component 0.2.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 xactflow-component 0.2.0
File Size Uploaded Provenance Actions
xactflow_component-0.2.0.tar.gz 35.8 kB With provenance Details for xactflow_component-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xactflow-component 0.2.0
File Interpreter ABI Platform Actions
xactflow_component-0.2.0-py3-none-any.whl Python 3 none any Details for xactflow_component-0.2.0-py3-none-any.whl

Total release size: 66.9 kB

Release files / xactflow_component-0.2.0.tar.gz

Download URL xactflow_component-0.2.0.tar.gz
Size 35.8 kB
Tags Source
SHA-256 checksum
How to use checksums
408d019f5c63d70026200656378a9bb0923d8976e5df1473b8e8ad9be7fb9f50
BLAKE2b-256 checksum
How to use checksums
caa7903ad8053133f95854809e3e940cb05194528629828bbae4ca9fda6d9a20
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 Nov 6, 2026.

Transparency log

Release files / xactflow_component-0.2.0-py3-none-any.whl

Download URL xactflow_component-0.2.0-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55dff071e82315448402e9e70f1dae15eb5fea7b30919885995f9e83d128f88a
BLAKE2b-256 checksum
How to use checksums
429ea4837ae448e0962739de21b1c4855e0f460828847ad94b335c598fb90ac8
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 Nov 6, 2026.

Transparency log

Security for xactflow-component 0.2.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 xactflow_component-0.2.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 Nov 6, 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