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.1.0.tar.gz (7.9 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.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mightyspatial-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d4a00cfd248bd6de5930d844b426ce0d26af891bfc7f7179598827287256f73b
MD5 b7439ccbff6e8c8923b7a0e4e55376b9
BLAKE2b-256 e2fad67a1895dde0fd7a91b67fdfe17c0fa45156bb56bdff05a39e3e7a3a19dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mightyspatial-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97d320e509cf22dd470c93090c0b39f94ea9ad4c9b84af1fd50a7388c24937fb
MD5 1a5c112c7766051428e4b6c370bac83c
BLAKE2b-256 4322bbd2140ac3daa39553e1a0fb99a20f6a7359da3ede5a4dec78c7ade4ef38

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