Metadata-Version: 2.4
Name: ifckit
Version: 0.1.1
Summary: Framework-agnostic IFC builder library for architecture and infrastructure
Author-email: Sander Boer <sanderboer@mauc.nl>
License: MIT
Project-URL: Homepage, https://github.com/maucworks/ifckit
Project-URL: Repository, https://github.com/maucworks/ifckit
Project-URL: Issues, https://github.com/maucworks/ifckit/issues
Keywords: ifc,bim,architecture,ifcopenshell,grasshopper,rhino
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: ifc
Requires-Dist: ifcopenshell>=0.7.0; extra == "ifc"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ifcopenshell>=0.7.0; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Provides-Extra: api
Requires-Dist: fastapi>=0.111; extra == "api"
Requires-Dist: uvicorn[standard]>=0.29; extra == "api"
Provides-Extra: all
Requires-Dist: ifcopenshell>=0.7.0; extra == "all"
Requires-Dist: fastapi>=0.111; extra == "all"
Requires-Dist: uvicorn[standard]>=0.29; extra == "all"

# ifckit

Framework-agnostic IFC builder library for architecture and infrastructure.

![Tests](https://github.com/maucworks/ifckit/actions/workflows/tests.yml/badge.svg)
![PyPI](https://img.shields.io/pypi/v/ifckit)

Build valid IFC files in pure Python — no CAD host required.
Works standalone, from Grasshopper, or via the JSON/CLI interface.

## Install

```bash
pip install ifckit[ifc]    # with ifcopenshell (full functionality)
pip install ifckit         # without ifcopenshell (JSON/schema tools only)
```

Requires Python 3.10+.

## Quick start: building

```python
from ifckit import IfcModel, IfcSchema, PendingWall, Vec, Plane

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

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",
)
floor.add(wall)
model.save("project.ifc")
```

See `examples/quickstart.py` and `examples/simple_building.py` for fuller examples.

## Quick start: bridge

```python
from ifckit import IfcModel, IfcSchema, LengthUnit, PendingBeam, Vec, Line, BridgePartType, IBeamProfile

model = IfcModel(name="Bridge", schema=IfcSchema.IFC4X3, author="you", unit=LengthUnit.MILLIMETRE)
deck = model.add_site("Site A").add_bridge("Main Bridge").add_bridge_part("Deck", BridgePartType.DECK.value)

profile = IBeamProfile(height=600, width=300, web_thickness=10, flange_thickness=10)
beam = PendingBeam(axis=Line(Vec(0, 0, 0), Vec(3000, 0, 0)), profile=profile, name="Main Girder")
deck.add(beam)

model.save("bridge.ifc")
```

See `examples/quickstart_bridge.py` and `examples/simple_bridge.py` for fuller examples including alignments.

## Supported schemas and element types

| Element | Class | IFC4 | IFC4X3 |
|---|---|:---:|:---:|
| Wall | `PendingWall` | ✓ | |
| Slab | `PendingSlab` | ✓ | |
| Column | `PendingColumn` | ✓ | |
| Beam | `PendingBeam` | ✓ | ✓ |
| Space | `PendingSpace` | ✓ | |
| Alignment | `PendingAlignment` | | ✓ |

Profiles: `IBeamProfile`, `LBeamProfile`, `SteelProfile`, and arbitrary polygon profiles.

## JSON build

Build an IFC file from a JSON description — useful for CLI pipelines and REST APIs:

```python
from ifckit.json_build import build

build("model.json", "output.ifc")
```

Or from the command line:

```bash
python -m ifckit model.json output.ifc
```

The JSON schema mirrors the Python API. See `examples/example_building.json` for a full example.

## Grasshopper

Grasshopper Script components are in `grasshopper/src/`. Each component is a
standalone Python file with `@component` / `@input` / `@output` annotations.

To regenerate the `.gh` file from source, run `grasshopper/script/build_gh.py`
inside the Rhino ScriptEditor with Grasshopper open.

## Development

```bash
pip install -e ".[dev]"
pytest tests/          # run tests
ruff check ifckit/     # lint
```
