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_by_name(id, "Name"))  # e.g. Text('Wall')

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

Names resolve against the release the file's header declares, inherited attributes included; attribute_names(id) lists them in slot order with their optional and derived flags. attribute(id, index) and set_attribute(id, index, value) address a slot by position.

Entities, plain values, property sets

A pure-Python layer over those calls reads like IfcOpenShell:

import openbim_ifc
model = openbim_ifc.open("model.ifc")
for wall in model.by_type("IfcWall"):          # subtypes included
    print(wall.Name, wall.psets["Pset_WallCommon"]["IsExternal"])
wall.Name = "Renamed"                           # coerced: IfcLabel, written 'Renamed'
frame = model.to_dataframe("IfcWall")           # pip install 'openbim-ifc[pandas]'

Reads give plain Python values; a typed wrapper's type name, * and .U. (both None) and the text/enum distinction are lost there, and wall.raw("Name") keeps them. wall.psets and wall.qtos are read-only mappings with type values inherited; write with wall.set_property(...). The package is typed (py.typed) and checked with mypy --strict.

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.

The calls that take these values write them exactly. A by-name write of a bare Python value (wall.Name = "x", set_attribute_by_name_plain) is coerced against the attribute's declared type instead: "x" becomes a label or an enumeration item, 3 an Integer or a Real, as the attribute declares; a value the declaration cannot settle, such as a string several SELECT members take, raises ambiguous-value rather than guess.

Errors

Every failure raises IfcError with a stable code (parse, missing-entity, invalid-value, unsupported-schema, ...; the Python guide lists them all). 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, writing property sets and quantities as one checked transaction (set_properties), the Pythonic layer over them (#332), and creating entities as one checked transaction (author with AuthorOps: entities by type and named attributes, the spatial structure, placed, contained and typed products, removal with relationships; #330), and each product's world placement and Body (product_placements; meshes from a --features mesh wheel, #328; the exact Body as Axiolid's geometry graph, product_geometry, from a --features graph wheel, #367).

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.11.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.11.0
File Size Uploaded
openbim_ifc-0.11.0.tar.gz 4.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for openbim-ifc 0.11.0
File
openbim_ifc-0.11.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
openbim_ifc-0.11.0-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
openbim_ifc-0.11.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
openbim_ifc-0.11.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: 18.2 MB

Release files / openbim_ifc-0.11.0.tar.gz

Download URL openbim_ifc-0.11.0.tar.gz
Size 4.5 MB
Tags Source
SHA-256 checksum
How to use checksums
d311e063064c5d95d16adf7a32c7f262d5868051d22272fa5f5a0920d01fb702
BLAKE2b-256 checksum
How to use checksums
0bf2c99fa66fdd423a738adfe73174521d653d4f9d877e3f0dfb0598c337099a
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 14, 2026.

Transparency log

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

Download URL openbim_ifc-0.11.0-cp39-abi3-win_amd64.whl
Size 2.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
337c3e0f856ee3d92affcecb2502c52fecd1648935c5c19be2f051eb1f2633d2
BLAKE2b-256 checksum
How to use checksums
98e8aa99735ca1b3a9caa7a9fe94cb5dd3f4113b4cb266423dfd9f00a15337df
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 14, 2026.

Transparency log

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

Download URL openbim_ifc-0.11.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 2.8 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
c983232ed727332d4db4f3f90e70fe057a4fbcf2496beec75d82763adf590cda
BLAKE2b-256 checksum
How to use checksums
658d4d673486603a3a72dff72452a46dccb4b65c1f4031434d7ce6ce0ba1b9cb
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 14, 2026.

Transparency log

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

Download URL openbim_ifc-0.11.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 2.7 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
3b560b19b22493e325b83bded3ba1426ae8c8b353aede6a5fe56efc8bb50b0b0
BLAKE2b-256 checksum
How to use checksums
7e468d998b2a516ddeb3f4a797bcb2b764f42d40d52fcd7335eeee5384ddd3b2
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 14, 2026.

Transparency log

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

Download URL openbim_ifc-0.11.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 5.4 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
9ee8f57653b01a7be446db0904d4c982df261709a368f28803b5b60c2964ea10
BLAKE2b-256 checksum
How to use checksums
7c1a01a0b5ed974c7286f1b0c16ac6a61f7b0bacc76e6e1d63b84ef225eda746
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 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.12.0

5 release files

This release

0.11.0 This release

5 release files

0.10.0

5 release files

0.9.0

5 release files

0.8.0

5 release files

0.7.0

5 release files

0.6.1

5 release files

0.6.0

5 release files

0.5.0

5 release files

0.4.0

5 release files

0.3.3

5 release files

0.3.2

5 release files

0.3.1

5 release files

0.3.0

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