Renders ArchiMate models from Open Exchange Format XML or Archi .archimate files, or from Python data, in layer bands from top to bottom:
- Lilac: Motivation
- Tan: Strategy
- Yellow: Business
- Blue: Application
- Green: Technology, including the Physical elements
- Pink: Implementation & Migration
- Grey: Other (Location, Grouping, and any other layer)
A band only appears when the model has elements in it. Every ArchiMate 3.2 element type is drawn with its notation icon, junctions as small dots (filled for And, hollow for Or) in the band of the elements they join, and all 11 relationship types with their notation.
The diagram is laid out as a layered view: Business, Application and Technology each split into labelled bands by role (actors and roles, business services, business processes and objects; application services and interfaces, applications and data; technology services, infrastructure), with elements in columns and relationship lines running in the gaps between them, never through an element. Within a layer, elements joined by Composition, Aggregation, Assignment or Realization are nested, so that line disappears; a container keeps its own services and interfaces on its top row. Elements are drawn as a ring in their layer's colour over a light fill of it, in the look the anywidgets share.
Install
uv add anywidget-archimate
Usage
from anywidget_archimate import ArchiMate
# From an XML file
widget = ArchiMate.from_xml("model.xml")
widget
# Or load later
widget = ArchiMate()
widget.load_xml("model.xml")
From Python data
widget = ArchiMate(
elements=[
{"id": "a1", "name": "Web shop", "type": "ApplicationComponent", "layer": "Application", "documentation": ""},
{"id": "t1", "name": "App server", "type": "Node", "layer": "Technology", "documentation": ""},
],
relationships=[
{"id": "r1", "source": "t1", "target": "a1", "type": "Serving", "name": ""},
],
height=500,
)
layerisMotivation,Strategy,Business,Application,Technology,ImplementationorOther, in any case;Implementation & MigrationandPhysical(Technology) work too. Without a layer, or with one the widget does not know, the element goes to the layer of its type, else to Other.typeis an ArchiMate 3.2 element type such asBusinessProcess,Capability,GoalorWorkPackage; a junction isAndJunctionorOrJunction. Other types draw as a plain box.- Relationship
typeis one ofComposition,Aggregation,Assignment,Realization,Serving,Access,Influence,Triggering,Flow,SpecializationorAssociation. - Names, documentation and the other values are shown as text, never as HTML.
heightsets the diagram's height in pixels. Left at 0 (the default), the widget fills the cell's width at 16:10, at least 360px and at most 80% of the screen high.
Selection and highlights
Clicking an element sets selected_element to its dict and opens its details beside the diagram (show_details=False keeps them closed, for a host that shows the selection itself). The host can also select or outline elements:
widget.selected_element = {"id": "a1"} # a dict with at least the id
widget.highlight_ids = ["a1", "t1"] # outline several elements
widget.observe(lambda change: print(change["new"]), names="selected_element")
Comparison styling
To show several runs of one model, give elements and relationships an optional status:
status |
Element | Relationship |
|---|---|---|
partial |
dashed and faded | faded |
changed |
amber fill | amber line |
only_a |
red fill | red line |
only_b |
green fill | green line |
ghost |
very faint and dashed | very faint |
stable or no status draws as usual. An optional badge on an element (for example "2/3") is drawn in its top left corner; text longer than 26 characters is cut.
Reading a large model
- Quiet lines: relationship lines are drawn faint until you point at or select an element; then its lines, and those of the elements inside it, show at full strength. Exports draw every line in full.
- Folding: the "−" on a container's header folds it into one box (it shows how many elements it holds) and its relationships attach to the box; "+" unfolds it.
- Nest relationships: a relationship that more than half of a container's children share, with the same type and the same element at the other end, is drawn once at the container. Point at it to see the elements it stands for; its tooltip lists the relationships.
- Opening view: a model too large to read when fitted opens at a readable size from the top; the fit button shows the whole model.
Toolbar
The toolbar opens the filter panel (hide layers, element types and relationship types; turn off "Nest elements" or "Nest relationships"), opens an .xml or .archimate file, exports the diagram as SVG or PNG (one menu), fits the diagram to the view and switches between light and dark. The filter panel starts open when the widget is 900px or wider. The theme follows the host page (marimo, Jupyter, VS Code, or the operating system) unless you choose one: pass dark_mode=True or dark_mode=False, set widget.dark_mode, or use the toolbar switch.
Development
git clone https://github.com/StevenBtw/anywidget-archimate.git
cd anywidget-archimate
uv sync
uv run pytest
The examples/demo_marimo.py example needs marimo, which is an optional extra:
uv sync --extra examples
License
Apache-2.0
Metadata
Release files for anywidget-archimate 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anywidget_archimate-1.0.0.tar.gz | 282.4 kB | With provenance | Details for anywidget_archimate-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anywidget_archimate-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for anywidget_archimate-1.0.0-py3-none-any.whl |
Total release size: 361.0 kB
Release files / anywidget_archimate-1.0.0.tar.gz
| Download URL | anywidget_archimate-1.0.0.tar.gz |
|---|---|
| Size | 282.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c84fc8673e4b73be4b906d476ccdd699c4829e2f0aec44d70724268a1a434f2
|
|
BLAKE2b-256 checksum How to use checksums |
6ea1e2389d20629c428550014a9aa448e3512ae5af78634e1979a9a6d8364ccc
|
| 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 14, 2026.
Transparency logRelease files / anywidget_archimate-1.0.0-py3-none-any.whl
| Download URL | anywidget_archimate-1.0.0-py3-none-any.whl |
|---|---|
| Size | 78.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c23eaa9d3c58561f323ed80057b99b2ebe377823a77d0f319b4227c70ac3c27
|
|
BLAKE2b-256 checksum How to use checksums |
ffa08ef4acc7056d6dec86784411f855d7535e8684db7c5533021f35107abad8
|
| 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 14, 2026.
Transparency logSecurity for anywidget-archimate 1.0.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.
Attestation for anywidget_archimate-1.0.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 14, 2026.
Transparency logA 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.