Skip to main content

xactflow-design

A XactFlow exporter plugin that serializes an ipxact.Design object into a valid IEEE 1685-2022 IP-XACT design 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 Design, it writes the XML back out.

Installation

pip install xactflow-design

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_design import DesignExporter

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

The output file is named after the design'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 design again replaces its file, but a file of that name holding anything else (another VLNV, or not a design) raises FileExistsError.

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

from xactflow_design import design_to_bytes, write_design, write_design_file

element = write_design(design)              # the lxml ipxact:design root element
data = design_to_bytes(design)              # pretty-printed bytes, with an XML declaration and a generated-by comment
path = write_design_file(design, "out.xml") # writes and returns the path

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

xactflow archidesc design.py --then design --output out/
# writes out/<vendor>_<library>_soc_<version>.xml

export() raises TypeError for anything that is not an ipxact.Design. Accepting an LinkedDesign (re-materializing a fully resolved design back to XML, or writing out a matching designConfiguration alongside it) is a planned later addition, not an oversight. The exporter takes no options for now, so any --option / --then-option also raises TypeError.

Design notes

  • Element order comes from the XSD, not from the dataclasses. design's sequence puts displayName/shortDescription/description right after the VLNV, and componentInstance puts componentRef before powerDomainLinks, while the corresponding dataclasses declare those fields in a different order. The same mismatch repeats in interconnection and monitorInterconnection, whose nameGroup opens the element while the Python fields are trailing optionals. Every writer here follows the schema.
  • Expressions are written verbatim. Anything typed Expression in ipxact-compiler (tiedValue, externalPowerDomainReference, a parameter's value, the left/right of a partSelect's range, ...) has its value text emitted unchanged, never evaluated or reformatted, together with its minimum/maximum, xml:id and foreign attributes.
  • 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 whose value equals the schema default (resolve="immediate", type="string") are left out, which keeps the output close to hand-written IP-XACT and still round-trips exactly.
  • Interconnections and monitor interconnections share one XML container but two Python lists. design.xsd's interconnections element freely interleaves interconnection and monitorInterconnection children, but Design keeps them as two separate lists with no record of their original relative order. The writer emits every interconnection first, then every monitorInterconnection; the content is unaffected, only the interleaving is not preserved.
  • Required XSD cardinalities raise ValueError when left unsatisfied, instead of emitting invalid XML. An interconnection needs a second active interface or a hierarchical interface, an adHocConnection needs at least one internal or external port reference, a monitorInterconnection needs at least one monitor interface, a powerDomainLink needs at least one internal power domain reference, a choice needs at least one enumeration, and a partSelect needs indices or a range. Rather than silently writing an incomplete element for any of these, the writer raises a specific error naming the missing field.
  • design.xsd's key, keyref and unique constraints raise ValueError too. Component instance names, interconnection and monitor interconnection names (one shared namespace), ad hoc connection names, parameter ids and choice names must be unique; every activeInterface of an interconnection and every internalPortReference must name an existing component instance, and a parameter's choiceRef an existing choice. Simple types (xs:Name, xs:NMTOKEN, a parameter's type) are not checked.

Development

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

The tests round-trip the tests/xml/top_design.xml fixture and a hand-built design through the writer and back through the parser, validate the written XML against the design.xsd shipped with ipxact-compiler with lxml.etree.XMLSchema.assertValid, and re-run xactflow.SCR.run_single_doc_checks on the result.

License

LGPL-3.0. See LICENSE.

Metadata

Release files for xactflow-design 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-design 0.2.0
File Size Uploaded Provenance Actions
xactflow_design-0.2.0.tar.gz 19.0 kB With provenance Details for xactflow_design-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 34.0 kB

Release files / xactflow_design-0.2.0.tar.gz

Download URL xactflow_design-0.2.0.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
63057c66f5afa804ac2de10d71ee6905ac24208aab82e772718183873610f9a4
BLAKE2b-256 checksum
How to use checksums
00972e18701a507dedd80bd9727d908c4d584401796eea78ea090033e415c81f
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_design-0.2.0-py3-none-any.whl

Download URL xactflow_design-0.2.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b4b9542907e0c8fa3cda3911339e60b9401bc465aeb32264d7689e3234ee2b3
BLAKE2b-256 checksum
How to use checksums
7e2a1326154b8dafcfcc214ceaf039cccb9aafe7162c10bc82b55f7258acbb52
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-design 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_design-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