Skip to main content

dwg2geo (Python)

Convert engineering DWG drawings to GeoJSON from Python — the pure-Rust dwg2geo converter as a native extension. No AutoCAD, no LibreDWG, no GDAL needed.

pip install dwg2geo
import json
import dwg2geo

result = dwg2geo.convert_file("drawing.dwg")           # or dwg2geo.convert(raw_bytes)
fc = json.loads(result["geojson"])                     # GeoJSON FeatureCollection (local drawing coords)

print(result["feature_count"], "features")
print(result["converted"])                             # per-entity-type counts
print(result["skipped"], result["failed"])             # with reasons — auditable

Options: convert(data, polygonize_closed=False, curve_tolerance=None).

The result dict mirrors dwg2geo's EmbedResult:

key meaning
geojson FeatureCollection string in the drawing's local coordinates
feature_count, model_space_entities totals
converted / skipped / failed per-entity-type outcomes with reasons
warnings conversion warnings
bbox [minx, miny, maxx, maxy] or None
source_sha256 hash of the input bytes (audit trail)

Features carry resolved CAD style metadata (layer, color_rgb, color_index, linetype, lineweight_mm, text properties…). Coordinates are local — georeference with e.g. pyproj using the drawing's known CRS; dwg2geo never guesses one:

from pyproj import Transformer
transformer = Transformer.from_crs("EPSG:31983", "EPSG:4326", always_xy=True)
lon, lat = transformer.transform(x, y)

Deterministic: the same bytes always produce byte-identical GeoJSON on a given platform (across platforms — native vs WebAssembly — a few floating-point values may differ in the last digit).

License: MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwg2geo-0.2.2.tar.gz (156.8 kB view details)

Uploaded Source

Built Distributions

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

dwg2geo-0.2.2-cp39-abi3-win_amd64.whl (870.2 kB view details)

Uploaded CPython 3.9+Windows x86-64

dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (934.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (865.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

dwg2geo-0.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file dwg2geo-0.2.2.tar.gz.

File metadata

  • Download URL: dwg2geo-0.2.2.tar.gz
  • Upload date:
  • Size: 156.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dwg2geo-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d6bc931c0a4c56ee681fd8f92a2317aef0f4ab2f3fbe29426bd7fdb58ece55e9
MD5 461a66da9af8f9b7222a48e6e6dc4d9b
BLAKE2b-256 58da0bf6683fb306db76c50879ba4856e1f057bd95c29f7c6d7516cc2d9950a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.2.tar.gz:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: dwg2geo-0.2.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 870.2 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dwg2geo-0.2.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4d1b82f34e391e83c476ec64f685e375d3cc347de8bf61db3b11c98c76b92067
MD5 a7957a066a1441f821280e1e694771de
BLAKE2b-256 f6db7ee48dc7af0b708cc16e5740a46a59dc545e89639d9d06d9d8679ea3b83e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.2-cp39-abi3-win_amd64.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 541944ea1e8fe4b800c447de2aa721ffce6792f2ccc9bc839ef6b525b933ff10
MD5 7bf377fa9d2881edda0a3942e100b563
BLAKE2b-256 558ac081aedf89221629137c039b76421fadc7b448fc660588b1d4ee7010bd2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0221bd2774ddc762a6558511c2edfde924cfabac37e0b1257f04881744dd9a04
MD5 c6875f1fc0436294548fff2493872d31
BLAKE2b-256 0ce04960a5ba9318597e00a06cc2f73cd03f6173e79956c3ede5a6ed87cf45d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 e326d27fa2647111f514e5a6cb6d84c9762672a6d7617c4e88722b69d1dbb4b1
MD5 d3d9d826a617011d2278d1a2fddd96a9
BLAKE2b-256 042a0c6a26934d020c78eb2e7e430affd0215312129e0cc3b6d4ab2955689531

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.4

5 files

0.2.3

5 files

This release

0.2.2 This release

5 files

0.2.1

5 files

0.2.0

5 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page