Skip to main content

openbim-ifc (Python)

Read, edit and write IFC STEP files from Python. A thin binding over the openbim-ifc Rust crates: one abi3 wheel for CPython 3.9 and later.

pip install openbim-ifc

Documentation: Python guide · source and issues

from openbim_ifc import IfcModel, Text

with open("model.ifc", "rb") as f:
    model = IfcModel.parse(f.read())

print(model.schema, len(model))
for id in model.ids_of_type_including_subtypes("IfcWall"):
    print(id, model.attribute(id, 2))      # Name, e.g. Text('Wall')

model.set_attribute(id, 2, Text("Renamed"))
with open("out.ifc", "wb") as f:
    f.write(model.write())

Values

Attribute values are frozen dataclasses, one per STEP form: Null ($), Derived (*), Bool, Unknown (.U.), Integer, Real, Text, Binary, Enum, Ref (#42), List, and Typed (IFCLENGTHMEASURE(2.5)). They keep every distinction IFC makes, so a file read and written back through Python is unchanged.

Bare Python values are refused with TypeError: 3 could be an Integer or a Real, "x" a Text or an Enum, and the binding does not guess.

Errors

Every failure raises IfcError with a stable code: parse, write, missing-entity, invalid-value, out-of-range, unsupported-schema, io, unsupported-profile or feature-disabled. The codes are shared with the JavaScript and C bindings; a code is never renamed or reused.

Threads

parse releases the GIL while it reads. A model can be passed between threads; the GIL serialises calls on it.

Scope

The record model -- entities, attributes, the STEP codec, exact and subtype queries -- plus lenient reads (ParseOptions), the STEP header, validation, ifcXML, the reachability lint and the read-only domain views (property sets and quantities, the spatial tree, classification, materials, systems, cost, georeferencing; #123), each as frozen dataclasses, and writing property sets and quantities as one checked transaction (set_properties). Geometry and checked multi-edit transactions over arbitrary entities are not bound yet.

Build from source

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

Faster reading (opt-in)

maturin build --release --features rusty_alloc

Uses the pure-Rust rusty_alloc allocator for the extension's own memory: reading STEP into a model takes 18-35% less CPU time on seven real IFC files, at 1-7% less peak memory (#49). Python's own allocator is not replaced. Off by default because a global allocator is a build-time choice; the version is pinned exactly.

Metadata

Release files for openbim-ifc 0.3.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 openbim-ifc 0.3.0
File Size Uploaded
openbim_ifc-0.3.0.tar.gz 4.3 MB Details

Built distributions (wheels)

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

Total release size: 17.2 MB

Release files / openbim_ifc-0.3.0.tar.gz

Download URL openbim_ifc-0.3.0.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
fddbd76d1e5ee10bd622cc478a141b97b0d482bf1fa59100231039ce1bed13e7
BLAKE2b-256 checksum
How to use checksums
bc3dd3498639974737e40d228e02504bc3e8d3c93f0901e8697a60b169c4ad1d
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 3, 2026.

Transparency log

Release files / openbim_ifc-0.3.0-cp39-abi3-win_amd64.whl

Download URL openbim_ifc-0.3.0-cp39-abi3-win_amd64.whl
Size 2.6 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f3dd5294b557f758be103a5ce7e532354233efdaaff711f7b6322335c279aa4a
BLAKE2b-256 checksum
How to use checksums
3270b84b11df842309b11b82a70675b53c70c4afa8361c5daeeee12323291077
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 3, 2026.

Transparency log

Release files / openbim_ifc-0.3.0-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL openbim_ifc-0.3.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
6b6876fcca915381b6c66d6d0ee35c6dfaf3aa507e6c24c3e99e30a72005b32a
BLAKE2b-256 checksum
How to use checksums
c1275b395b245d9902032de29058a4ab9927fa5e1af8767c29733f44bd858478
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 3, 2026.

Transparency log

Release files / openbim_ifc-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL openbim_ifc-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 2.5 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
b3b8cf4e96349ae9cd4f342d255c9113de778200f30464f7a69ba3902c621d96
BLAKE2b-256 checksum
How to use checksums
9801394f06d45d2e813c9330a0d8305efd853c0b244ea6968435f5180d84255a
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 3, 2026.

Transparency log

Release files / openbim_ifc-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL openbim_ifc-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 5.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
75eea0aa23ecabfe4d7ae968390a380b39cc65cac8052ca08214825649e8fe46
BLAKE2b-256 checksum
How to use checksums
f8c3b2d32a03ef2ecc265e79e46734ea85980a69eb279ad5270d3f0baa74819f
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 3, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.2

5 release files

0.3.1

5 release files

This release

0.3.0 This release

5 release files

0.2.1

5 release files

0.1.0

5 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