Skip to main content

openbim-ifcx (Python)

Read, write, validate and compose IFC5 / IFCX files, and export them as GLB, from Python. A thin binding over the openbim-ifcx Rust crate, from the openbim-ifcx-py crate in openbimrs/ifcx: one abi3 wheel for CPython 3.9 and later.

The documentation has a Python guide and the API reference; the viewer shows an IFCX file in the browser.

Targets the ifcx_alpha draft of buildingSMART's IFC5. IFCX is still a moving draft; see the capabilities.

pip install openbim-ifcx

Example

from pathlib import Path
from openbim_ifcx import IfcxFile, compose, export_glb

model = Path("model.ifcx").read_bytes()
file = IfcxFile.parse(model)              # str or bytes
print(file.header["id"], file.node_count)

report = file.validate()
for f in report["failures"]:
    print(f["node"], f["attribute"], f["pointer"], f["kind"], f["message"])
Path("copy.ifcx").write_text(file.write())  # unchanged from the input

# Layers weakest first: the last layer's opinions win.
tree = compose([model, Path("overlay.ifcx").read_bytes()])
print(list(tree["children"]))              # the root nodes

# Any glTF viewer opens the result.
Path("model.glb").write_bytes(export_glb([model, Path("overlay.ifcx").read_bytes()]))

API

Call Returns
IfcxFile.parse(data) an IfcxFile; data is JSON text or UTF-8 bytes
file.write(pretty=False) the file as JSON text, lossless
file.to_dict() the file as plain dicts and lists
file.header the header dict
file.node_count number of entries in data
file.validate() a validation report against the file's own schemas
compose(layers, imports=None) the composed tree as nested dicts
validate(layers, imports=None) a validation report over all layers and resolved imports
export_glb(layers, imports=None, *, y_up=True, origin_on_root=True) the composed model as binary glTF 2.0 bytes

layers is one file or an iterable of files, weakest first. The package ships type hints (py.typed).

Lossless round trip. write() keeps key order, fields the draft does not define, null deletions and every number exactly as read.

Composed tree. compose returns the artificial root (path "") over every root node. Each node is {"path", "attributes", "children"}, the shape of upstream's PostCompositionNode, with children keyed by child name. Nodes shared through inheritance appear once per place they are used.

Imports. Without imports, imports are not resolved: the layers' schemas and data are concatenated in order, as upstream's Federate does. With imports (a mapping from the exact import uri to a file, possibly empty), the layers become the imports of a synthetic main layer, as upstream's ifcx compose command builds it, and every import must be supplied. integrity values are checked against the supplied bytes. In upstream order an import overrides the layer that imports it, and a later layer overrides both. Nothing is fetched from the network or the filesystem.

GLB export. export_glb writes the render scene of the composed tree: transformed, instanced meshes, lines and points with their materials, one glTF node per instance named by its IFCX path. The root node turns IFCX's Z-up into glTF's Y-up (y_up=False keeps Z-up) and carries the scene origin, so georeferenced models keep their coordinates (origin_on_root=False centres the model on the glTF origin instead). Geometry values that do not decode are left out.

Validation report. {"valid": bool, "failures": [...]}, each failure {"node", "attribute", "pointer", "kind", "message"}: the node path, the attribute id, an RFC 6901 pointer into the value ("" for the value itself), a stable kind such as missing-schema, type-mismatch, not-an-integer, not-an-option, missing-key, too-few-elements or too-many-elements, and a human message.

Errors

Every failure raises IfcxError with a stable code:

code Meaning
read not an IFCX file: invalid JSON or the wrong shape; the message gives line and column
write the file could not be written
layer imports could not be resolved: a missing file, an import cycle, an integrity mismatch
compose a reference cycle, or a reference to a node no layer defines
invalid-argument an argument of the wrong type, or no layers
glb the scene could not be written as GLB (over 4 GiB)

The codes are shared with the JavaScript binding (@openbim/ifcx); a code is never renamed or reused.

Threads

Parsing, composing, validating and GLB export release the GIL. An IfcxFile is immutable and can be shared between threads.

Build from source

uv venv && . .venv/bin/activate
uv pip install maturin
maturin develop --release     # or: scripts/check-python.sh to build + test

License

MIT, like the rest of openbimrs/ifcx.

Metadata

Release files for openbim-ifcx 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openbim-ifcx 0.1.2
File Size Uploaded
openbim_ifcx-0.1.2.tar.gz 148.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for openbim-ifcx 0.1.2
File
openbim_ifcx-0.1.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
openbim_ifcx-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
openbim_ifcx-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
openbim_ifcx-0.1.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 10.12+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) Details

Total release size: 2.9 MB

Release files / openbim_ifcx-0.1.2.tar.gz

Download URL openbim_ifcx-0.1.2.tar.gz
Size 148.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8d520e191bb82393bc56501534f0761c2986e8b5f5999738abd4d37880ba29fa
BLAKE2b-256 checksum
How to use checksums
4b4d4cc0944b15d6ef09b9879759c9eb231dc35cb4b4d85631a98e8ab9c06212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / openbim_ifcx-0.1.2-cp39-abi3-win_amd64.whl

Download URL openbim_ifcx-0.1.2-cp39-abi3-win_amd64.whl
Size 512.5 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
454954e07e4389893a4d2004440203a98d2c269dd23fb1848540b2b75a47960c
BLAKE2b-256 checksum
How to use checksums
85ad401c2c7a49b9a18cf0f7c5deeb49d1e1e4e2db6add996ba7baf47fb6587d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / openbim_ifcx-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL openbim_ifcx-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl
Size 597.2 kB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
97f789ec295179dfd8c23b69d994a5594e02f827d5dff6c57456bfb340ebedd6
BLAKE2b-256 checksum
How to use checksums
5889ed893cd1aea0b9e1a4eb025be0a96456936b8497791f68c5f0baf19cf260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / openbim_ifcx-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL openbim_ifcx-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl
Size 556.9 kB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
044550c96c0a9af2781e0d0bb2198ed62e463c61ccb39e06a15bb120b2fc8d3c
BLAKE2b-256 checksum
How to use checksums
e05c5c238bdb5df5fad35200a90213d879b8bd06de363b2c47330d8dda4dbc35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / openbim_ifcx-0.1.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL openbim_ifcx-0.1.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 1.1 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
65cea934ce4af54e3265c3d4be6c7e650746d9cf22854eed16a89cce73da9c81
BLAKE2b-256 checksum
How to use checksums
da24d9c2ce7d3303bbe9df77ebdb54160d8abe747c9599c7c43f990d3adc9536
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

5 release files

0.1.1

5 release files

0.1.0

4 release 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