Python implementation of IFC to ifcOWL/LBD converter. Currently it covers "lite" version of ifcOWL which means that values in IFC step file are represented as literal (e.g. for GUID is direct string instead of pointing out to another triple GlobalUniqueID_IfcProduct(number))
main.py- just an entry pointcli.py- CLI appconvert.py- Converter options (spf load, or stream)ifc_options.py- IFC utilities (load, stream, getting schemas for namespace (and for full ifcOWL in the future))
I provided a few IFC files you can try right away (in tes_files folder).
If you are using PyPi and venv, then I would suggest just add your IfcOpenShell to your virtual environment and run it with python like so:
# Basic
python run src/main.py --inputs input.ifc --outputs output.ttl
# With some flags
python run src/main.py --inputs input.ifc --outputs output.ttl --verboseNOTE So far, SPF will be behind in the contrary to the stream writer. For the up-to-date version, please use experimental-conda environment.
# Basic usage (loads to memory)
pixi run -e stable-conda python src/main.py --inputs input.ifc --outputs output.ttl
# With verbose logging (timestamps for each step)
pixi run -e stable-conda python src/main.py -i input.ifc -o output.ttl --verbose
# With streaming (for large files)
pixi run -e stable-pypi python src/main.py -i input.ifc -o output.ttl --stream
pixi run -e stable-conda python src/main.py -i input.ifc -o output.ttl --stream
pixi run -e experimental-conda python src/main.py -i input.ifc -o output.ttl --stream
# All options together
pixi run -e experimental-conda python src/main.py -i input.ifc -o output.ttl -v -sNOTE - the TRIG is not there yet.
# Multiple files (automatically uses TRIG format)
pixi run -e stable-conda python src/main.py \
--inputs file1.ifc file2.ifc file3.ifc \
--outputs file1.trig file2.trig file3.trig \
--verbose
# With streaming for large files
pixi run -e experimental-conda python src/main.py \
-i data/input/Duplex.ifc data/input/Girder.ifc data/input/Viadotto.ifc \
-o data/output/Duplex.trig data/output/Girder.trig data/output/Viadotto.trig \
-v -s-i, --inputs: Input IFC file(s) - at least one required-o, --outputs: Output file(s) - must match number of inputs-v, --verbose: Show timestamped progress for each step-s, --stream: Stream IFC files instead of loading to memory (useful for large files)
- Input/Output matching: Number of inputs must equal number of outputs
- Format selection:
- Single file → TTL (Turtle) format
- Multiple files → TRIG format (named graphs) (don't worry about it, it's not yet implemented)
- Load vs Stream:
- Default: Load entire IFC to memory
--stream: Stream IFC file (good for large files, also fast - it currently runs on all buildsstable-pypi,stable-conda,experimental-conda)
pixi run -e stable-conda python src/main.py --help[2025-10-20 17:17:22.182] Starting IFC to LBD conversion
[2025-10-20 17:17:22.182] Processing 1 file(s)
[2025-10-20 17:17:22.183] Mode: Load to memory
[2025-10-20 17:17:22.183] [1/1] Converting 'input.ifc' -> 'output.ttl'
[2025-10-20 17:17:22.317] [1/1] Completed successfully
[2025-10-20 17:17:22.317] ==================================================
[2025-10-20 17:17:22.317] Conversion complete: 1/1 successful
It uses pixi manager (this way you can switch between pypi and conda version of IfcOpenshell).
The project supports multiple pixi environments:
-
stable-conda: Main development environment (recommended)- Stable ifcopenshell from conda
- Full feature support including streaming
- Use:
pixi run -e stable-conda ...
-
stable-pypi: Alternative stable environment- IfcOpenShell from PyPI
- It supports streaming
- Use:
pixi run -e stable-pypi ...
-
experimental-conda: Bleeding-edge features- Latest ifcopenshell with newest features
- Use for testing new capabilities
- Use:
pixi run -e experimental-conda ...
-
test: Testing environment- Includes pytest
- Use:
pixi run -e test pytest
For conda developers:stable-conda
pixi run -e stable-conda python src/main.py -i input.ifc -o output.ttlFor streaming large files (and potentially faster conversion): experimental-conda with streaming flag (--stream).
pixi run -e stable-conda python src/main.py -i large.ifc -o output.ttl -s -vFor PyPi developers: stable-pypi:
pixi run -e stable-pypi python src/main.py -i input.ifc -o output.ttl
pixi run -e test pytest