Skip to main content

High-performance Python bindings for the ifc-lite IFC parser

Project description

ifc-lite

High-performance Python bindings for the ifc-lite IFC parser.

Relationship with upstream

This Python version is not released or maintained by the original authors of ifc-lite. It is a modified version, released under the same licence.

The Rust code is basically copied from upstream, but with some changes:

  • The MeshData object exposes property_sets as an attribute, and the Rust code has been changed to populate this for all elements.
  • Added include_geometry option to StreamingOptions in the processing crate. When false, geometry extraction is skipped and MeshData objects are returned with empty geometry but fully populated metadata.
  • Added process_ifc_text_with_options and process_ifc_file_with_options to the engine crate for non-streaming use with include_properties and include_geometry flags.

These changes are based on the current needs of the maintainers, and are provisional, while we are still in the evaluation stage for this new library.

Installation

pip install ifc-lite

Quick Start

import ifc_lite

# Load an IFC file
model = ifc_lite.process_file("building.ifc")

# List all IFC types in the model
print(model.ifc_types)

# Get all reinforcing bars
bars = model.elements_by_type("IfcReinforcingBar")
for bar in bars:
    print(f"{bar.name}: {bar.vertex_count} vertices, {bar.triangle_count} triangles")
    print(f"  Properties: {bar.properties}")

# Access geometry (vertex positions, normals, triangle indices)
for mesh in model.meshes:
    positions = mesh.positions  # flat list of x,y,z triplets
    normals = mesh.normals      # flat list of nx,ny,nz triplets
    indices = mesh.indices      # triangle indices
    color = mesh.color          # RGBA tuple

# Load metadata + properties only (skip expensive geometry extraction)
model = ifc_lite.process_file("building.ifc", load_geometry=False)

# Load geometry only (skip property set parsing)
model = ifc_lite.process_file("building.ifc", load_properties=False)

# Fastest: metadata only (no geometry, no properties)
model = ifc_lite.process_file(
    "building.ifc", load_geometry=False, load_properties=False
)

API

Module-level functions

  • ifc_lite.process_file(path, *, load_geometry=True, load_properties=True) – Load and process an IFC file from disk
  • ifc_lite.process_text(content, *, load_geometry=True, load_properties=True) – Process IFC content from a string
  • ifc_lite.version() – Get the native library version

Optional keyword arguments:

  • load_geometry – When False, skip geometry extraction. MeshData elements will have empty positions/normals/indices but full metadata. Significantly faster for large files.
  • load_properties – When False, skip property set parsing. MeshData elements will have properties=None and property_sets=None.

IfcModel

  • model.meshes – List of all MeshData elements
  • model.ifc_types – All distinct IFC type names
  • model.elements_by_type(type_name) – Filter elements by IFC type
  • model.element_by_express_id(id) – Lookup by express ID
  • model.element_by_global_id(gid) – Lookup by IFC GlobalId
  • model.metadata – Schema version, entity counts, coordinate info
  • model.stats – Processing timing statistics

MeshData

  • mesh.express_id, mesh.ifc_type, mesh.global_id, mesh.name
  • mesh.positions, mesh.normals, mesh.indices, mesh.color
  • mesh.properties – IFC property set values (dict or None)
  • mesh.vertex_count, mesh.triangle_count

License

MPL-2.0 (same as upstream ifc-lite)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ifc_lite-0.3.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ifc_lite-0.3.0-cp312-abi3-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12+Windows x86-64

ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

ifc_lite-0.3.0-cp312-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

ifc_lite-0.3.0-cp312-abi3-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file ifc_lite-0.3.0.tar.gz.

File metadata

  • Download URL: ifc_lite-0.3.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ifc_lite-0.3.0.tar.gz
Algorithm Hash digest
SHA256 56062ec266f16b40897bf156ef98774ea98bd874e5263fc16403de063952fac3
MD5 d9c083a9a78dcdee63eda8d5ce3077de
BLAKE2b-256 8bff5932c74ca2f25f2a26e4671df5cb4c7336291bfc3ba2bc531149d6cc98a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifc_lite-0.3.0.tar.gz:

Publisher: release.yml on spookylukey/ifc-lite-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifc_lite-0.3.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: ifc_lite-0.3.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ifc_lite-0.3.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6a4525142d9c8ec113530a20a81126fd49efe702528197f90bf933010dfe0bdd
MD5 d56cc80d643bc74bc22fc0cf71977fc7
BLAKE2b-256 94329321fa036ffbd8c4cf7aa205740d7c51da32722b425a2e0c6ce1201e465a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifc_lite-0.3.0-cp312-abi3-win_amd64.whl:

Publisher: release.yml on spookylukey/ifc-lite-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d1d4642ea8f9d375195589024fe89da85c33b6b1fa93cb850b5cbde70013f6d
MD5 72c6424fa66fd344e9448c07640909df
BLAKE2b-256 b53a0ac9775226ac56b6a92af9bb5307231d9b844e9e6340462d6d69169a3f20

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on spookylukey/ifc-lite-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5d6d13c00992f3eba9c21e8d8bca56d584ff0a20fd73694bf9eb6b6db14e014b
MD5 ab367caa8d362576e27da71ec5cc7564
BLAKE2b-256 13903a8d09bb0322d260db7bbe2c44797b39cb0c045eadaa7c87ce7b0fb08e42

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifc_lite-0.3.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on spookylukey/ifc-lite-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifc_lite-0.3.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ifc_lite-0.3.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f771021515bdb5c988f4550b7ef8fcc935032dfefc29bcec0f034319f4acc9bc
MD5 c19dc84e75c176ddbfd82b384e1150c8
BLAKE2b-256 28eac2364458418c1827fc27dbc85728c3227dc9c201f7accf09b78edf0f3fe5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifc_lite-0.3.0-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on spookylukey/ifc-lite-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifc_lite-0.3.0-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ifc_lite-0.3.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7b57a757bd704e13a252e1816a7694b338c75eded8f2beafcf946cab16e53a98
MD5 2994245c4bbbe3b7540e4d424caa147f
BLAKE2b-256 2ae5dbac9c77f18d0bbb198cda26bd00c4ced1c1ab878069ce28ddc3ccf9ae03

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifc_lite-0.3.0-cp312-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on spookylukey/ifc-lite-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page