Ifc2Data Python Client
A Python client for the Ifc2Data API https://www.ifc2data.com/
Ifc2Data allows you to upload IFC files and export structured datasets in multiple formats such as XLSX, CSV, SQL, JSON, and more.
This package provides both:
- A synchronous client (
Client) - An asynchronous client (
AsyncClient)
for seamless integration into Python applications, automation workflows, and backend services.
Features
- Synchronous and asynchronous support
- Multiple output formats supported
- Built-in parameter validation
- Automatic retry mechanism for network reliability
- Lightweight and easy to integrate
Installation
pip install ifc2data
Prerequisites
Before using this package :
- Create an account on Ifc2Data : https://www.ifc2data.com/signup/
- Request an API key : yohann.schatz@hesge.ch
Quick Start
Synchronous Client
from ifc2data import Client
api_key = "YOUR_API_KEY"
file_path = r"C:\path\to\your\file\File.ifc"
output_format = "xlsx"
parameters = {
"elements": ["IfcWall"],
"properties": ["IsExternal", "LoadBearing"],
"quantities": []
}
client = Client(api_key)
result = client.run(
file_path=file_path,
output_format=output_format,
parameters=parameters
)
if result.done:
output_path = client.download(
result,
r"C:\path\to\your\file"
)
print("Saved to:", output_path)
Asynchronous Client
import asyncio
from ifc2data import AsyncClient
api_key = "YOUR_API_KEY"
file_path = r"C:\path\to\your\file\File.ifc"
output_format = "xlsx"
parameters = {
"elements": ["IfcWall"],
"properties": ["IsExternal", "LoadBearing"],
"quantities": []
}
async def main():
client = AsyncClient(api_key)
result = await client.run(
file_path=file_path,
output_format=output_format,
parameters=parameters
)
if result.done:
output_path = await client.download(
result,
r"C:\path\to\your\file"
)
print("Saved to:", output_path)
asyncio.run(main())
How it works
- Upload an IFC model
- Configure extraction parameters
- Execute the processing pipeline
- Receive a structured API response
- Download the generated output file
Response
Response Object
The run() method returns a PipelineResponse object.
print(result.status)
print(result.message)
if result.data:
print(result.data.id)
print(result.data.file_name)
Response Structure
| Attribute | Type | Description |
|---|---|---|
status |
str |
Pipeline execution status |
message |
str |
Human-readable API message |
data |
PipelineData |
Processed file information |
done |
bool |
Returns True if processing succeeded |
Output Formats
| Format | Key |
|---|---|
| BSON (MongoDB) | bson |
| CSV | csv |
| JSON | json |
| SQL | sql |
| SQL (3NF) | sql_3nf |
| SQLite | sqlite |
| SQLite (3NF) | sqlite_3nf |
| Turtle | ttl |
| Excel (XLSX) | xlsx |
Parameters
The parameters dictionary controls how IFC data is filtered and exported.
Available Parameters
| Key | Required | Type | Empty Allowed | Description |
|---|---|---|---|---|
elements |
Yes | List[str] |
No | IFC classes to extract |
classifications |
No | List[str] |
Yes | Classification filters |
documents |
No | List[str] |
Yes | Document filters |
materials |
No | List[str] |
Yes | Material filters |
properties |
No | List[str] |
Yes | Property filters |
quantities |
No | List[str] |
Yes | Quantity filters |
Parameter Examples
Minimal Example
parameters = {
"elements": ["IfcWall"]
}
Multiple IFC Elements
parameters = {
"elements": [
"IfcWall",
"IfcDoor",
"IfcWindow"
]
}
Property Filtering
parameters = {
"elements": ["IfcWall"],
"properties": [
"FireRating",
"LoadBearing",
"IsExternal"
]
}
Material Filtering
parameters = {
"elements": ["IfcSlab"],
"materials": [
"Concrete",
"Steel"
]
}
Quantity Extraction
parameters = {
"elements": ["IfcBeam"],
"quantities": [
"Length",
"CrossSectionArea",
"NetVolume"
]
}
No Filter Example
parameters = {
"elements": ["IfcWall"],
"properties": []
}
Validation Rules
The SDK validates parameters before sending requests to the API.
Validation includes:
- Required parameter checks
- Output format validation
- IFC class validation
- Parameter type validation
- Unknown parameter detection
Invalid configurations raise a ValueError.
Error Handling
try:
result = client.run(
file_path,
output_format,
parameters
)
except ValueError as e:
print("Validation error:", e)
except Exception as e:
print("Request failed:", e)
Verbose Mode
Enable verbose mode to inspect API requests and responses.
result = client.run(
file_path=file_path,
output_format="xlsx",
parameters=parameters,
verbose=True
)
Verbose mode displays:
- Request URL
- Output format
- Parameters
- HTTP response status
- API response payload
Notes
- IFC files must be valid and readable
- Network retries are automatically handled internally
- Empty filter lists are normalized automatically
License
This project is licensed under the MIT License.
Author
Yohann Schatz
Metadata
Release files for ifc2data 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ifc2data-1.2.1.tar.gz | 11.2 kB | Without provenance | Details for ifc2data-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ifc2data-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for ifc2data-1.2.1-py3-none-any.whl |
Total release size: 22.0 kB
Release files / ifc2data-1.2.1.tar.gz
| Download URL | ifc2data-1.2.1.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8a1df1e4624937f16ea414e02774d8bf6ed060d43db9390dbd5595a01d61a27
|
|
BLAKE2b-256 checksum How to use checksums |
0c273537d8598986f2a4bc51c99216991ddaf5df1f0520369abb2d4e7925def2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / ifc2data-1.2.1-py3-none-any.whl
| Download URL | ifc2data-1.2.1-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87b82f9c6cb8c4a84afac09f83b82dc0372e590a519740541d6ab954b561b158
|
|
BLAKE2b-256 checksum How to use checksums |
dc98af2fae64da277132c261be5b978fbaabdc1aa2cf4b2b2a8934c266fcb711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for ifc2data 1.2.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.