Skip to main content

Framework-agnostic IFC builder library for architecture and infrastructure

Project description

ifckit

Framework-agnostic IFC builder library for architecture and infrastructure.

What it is

ifckit lets you construct IFC files in pure Python. It has one external dependency: ifcopenshell. It knows nothing about Rhino, Grasshopper, FastAPI, or any other host.

Frontends (Grasshopper Python, FastAPI, CLI) are thin adapters that convert their geometry types to ifckit primitives and call the library API.

Supported schemas

  • IFC4 — buildings: walls, slabs, beams, columns
  • IFC4x3 — infrastructure: bridges, bridge parts, alignments

Quick start

from ifckit import IfcModel, IfcSchema, PendingWall, Vec, Plane, validate
from ifckit.builders import default_registry
from ifckit.builders._geom import get_body_context

# Build the spatial hierarchy
model = IfcModel(name="My Project", schema=IfcSchema.IFC4, author="you")
site  = model.add_site("Site A")
bldg  = model.add_building(site, "Building 1")
floor = model.add_storey(bldg, "Ground Floor", elevation=0.0)

# Define the element
wall = PendingWall(
    footprint=[Vec(0, 0, 0), Vec(10, 0, 0), Vec(10, 0.3, 0), Vec(0, 0.3, 0)],
    plane=Plane.world_xy(),
    height=3.0,
    name="North Facade",
)

# Validate, then build into the IFC file
result = validate(wall)
assert result.ok, result.errors

reg = default_registry()
ctx = get_body_context(model.ifc_file)
reg.get("basic_wall").build(model.ifc_file, wall, floor.entity, ctx)

model.save("output/project.ifc")

See examples/quickstart.py for the full runnable version.

Installation

pip install ifckit          # once published
# or locally:
pip install -e ".[dev,api]"

Development

make env          # create .venv + install all extras
make test         # run tests with coverage
make test-fast    # run tests, stop on first failure
make api          # start FastAPI dev server  →  http://127.0.0.1:8000/docs
make lint         # ruff check
make fmt          # ruff format + auto-fix
make help         # list all targets

Or directly with pytest / ruff:

pytest                                          # run tests
pytest --cov=ifckit --cov-report=term-missing  # with coverage
ruff check ifckit/                              # lint

See PLAN.md for the full milestone implementation plan.

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

ifckit-0.1.0.tar.gz (106.9 kB view details)

Uploaded Source

Built Distribution

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

ifckit-0.1.0-py3-none-any.whl (105.3 kB view details)

Uploaded Python 3

File details

Details for the file ifckit-0.1.0.tar.gz.

File metadata

  • Download URL: ifckit-0.1.0.tar.gz
  • Upload date:
  • Size: 106.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ifckit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b76ead2d24e7b4db61ba93412de255f26e1ef80bbe1a3bcf0ef17d404f97a09f
MD5 7750071b1d497123c0ed1687419f4797
BLAKE2b-256 a5142c3e1b641f6dcdd7a0114ac474cec412a1141eb0a3b11948a4ddca05ea19

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifckit-0.1.0.tar.gz:

Publisher: publish.yml on maucworks/ifckit

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

File details

Details for the file ifckit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ifckit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 105.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ifckit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75d5defcbe475e9a7e218da41fcd0a1f25ace2c1a4a39e88faebe8050821cff0
MD5 0799ac5b339232148477387c4d68a695
BLAKE2b-256 3f714d974d909d581ac4c42d5f64f33f52c8a51fca737d0af3339171053911f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifckit-0.1.0-py3-none-any.whl:

Publisher: publish.yml on maucworks/ifckit

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