Skip to main content

Python SDK for the Mighty Spatial IFC-to-GIS conversion API

Project description

mightyspatial

PyPI version Python versions License: MIT

Python SDK for the Mighty Spatial IFC-to-GIS conversion API. Convert IFC (BIM) files to GeoJSON, GeoPackage, Shapefile, and File Geodatabase.

Documentation | Free Web Converter | Get API Key

Installation

pip install mightyspatial

Quick Start

One-step conversion

from mightyspatial import convert

# Convert with no API key (free tier: 5/month, up to 50MB)
result = convert("building.ifc")
print(result)  # /path/to/building.geojson

# Specify output format
convert("building.ifc", output_format="geopackage")

Using the client

from mightyspatial import MightySpatial

ms = MightySpatial(api_key="ms_...")

# One-step convert
ms.convert("building.ifc", output_format="geojson")

# Convert from a URL
ms.convert(file_url="https://example.com/model.ifc", output_path="output.geojson")

# Strip property name prefixes/suffixes
ms.convert("building.ifc", strip_prefix="Pset_", strip_suffix="_Value")

# Include CSV attribute tables
ms.convert("building.ifc", include_csv=True)

Preview and download (two-step)

ms = MightySpatial(api_key="ms_...")

# Step 1: Preview -- inspect layers and metadata before downloading
preview = ms.preview("building.ifc")
print(preview["detected_crs"])
print(preview["layers"])

# Step 2: Download in your preferred format
job_id = preview["job_id"]
ms.download(job_id, output_format="geopackage", output_path="building.gpkg")

Pipe generation

ms = MightySpatial(api_key="ms_...")

preview = ms.preview("pipes.ifc")
job_id = preview["job_id"]

# Find the polyline layer
polyline_layer = next(l for l in preview["layers"] if "Line" in l["geometry_type"])

# Generate 3D pipe geometry
pipes = ms.generate_pipes(
    job_id=job_id,
    source_layer=polyline_layer["name"],
    features=polyline_layer["geojson"]["features"],
    default_diameter=300,
    uom="mm",
    segments=8,
)
print(pipes["layer"]["feature_count"])

API key from environment variable

export MIGHTY_SPATIAL_API_KEY="ms_..."
from mightyspatial import convert

# Automatically uses MIGHTY_SPATIAL_API_KEY
convert("building.ifc")

Supported Output Formats

Format Extension Free Tier Pro Tier
GeoJSON .geojson Yes Yes
GeoPackage .gpkg -- Yes
Shapefile .shp.zip -- Yes
File GDB .gdb.zip -- Yes

Pricing

Tier Price Conversions Max File Size
Free $0 5/month 50 MB
Pro $0.50/conversion 100/month 500 MB
Enterprise Custom Unlimited Custom

Get your API key at mightyspatial.com/dashboard.

Error Handling

from mightyspatial import MightySpatial, RateLimitError, FileTooLargeError

ms = MightySpatial()

try:
    ms.convert("large_building.ifc")
except RateLimitError as e:
    print(e)           # Includes upgrade URL
    print(e.help_url)  # https://mightyspatial.com/dashboard
except FileTooLargeError as e:
    print(e)           # Includes tier limits

Links

License

MIT -- see LICENSE for details.

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

mightyspatial-0.2.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

mightyspatial-0.2.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file mightyspatial-0.2.1.tar.gz.

File metadata

  • Download URL: mightyspatial-0.2.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mightyspatial-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7d07f0df22adec9dedf2433ae612b5e408a6e7cd29ef4338a62c249d87cb69c0
MD5 407bd2706938d85de1661103d1fed2ce
BLAKE2b-256 ca59a2a213277902eb8dce7edaf64bf3acf0db24aff0717e0d94c69e1637d85a

See more details on using hashes here.

File details

Details for the file mightyspatial-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mightyspatial-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mightyspatial-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc825c0adf63740191519c55d1f3ffc1e03fcdce3230266679d0ae1a6fa6a09
MD5 96ade39d3149eda177f5a7607914a985
BLAKE2b-256 d2f01d05c483905a65c29ebc6cdd12653c455abd5033bb69ae8cb451838dfbf3

See more details on using hashes here.

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