geolibre-wasm (Python)
Run the geolibre-rust geospatial
tool suite (the whitebox_next_gen tools plus GeoLibre's own) from Python. The
tools are a single WebAssembly (WASI) module executed in-process via
wasmtime, so there is no
native install, no GDAL, and no server — just pip install.
This mirrors the JavaScript geolibre-wasm/tools API (list_tools,
list_manifests, run_tool), so the two stay in sync.
The import package is
geolibre_wasm(the distribution isgeolibre-wasm), matching the npm package name and avoiding a clash with the separategeolibreapplication package.
Install
pip install geolibre-wasm
On first use the runtime (geolibre-cli.wasm, ~20 MB) is downloaded from the
matching GitHub release and cached under ~/.cache/geolibre/. To use a local
copy instead, set GEOLIBRE_WASM=/path/to/geolibre-cli.wasm or pass
wasm_path= to any call.
Usage
Inputs are placed under /work; the tool reads/writes there and any new files
come back as bytes. Each input value may be bytes, an http(s) URL
to download, or a local file path -- the same for raster and vector inputs:
res = gl.run_tool(
"write_geoparquet",
args=["--input=/work/in.geojson", "--output=/work/out.parquet"],
input={"in.geojson": "https://example.com/data/cities.geojson"}, # fetched for you
)
This downloads the whole file (no HTTP range reads). Works for cog.tif,
data.parquet, data.fgb, data.geojson, etc.
Paths are sandboxed. Every path inside
argsrefers to the tool's/workfilesystem, not your host disk.inputfiles are placed at/work/<name>, andres.fileskeys are paths relative to/work. Do your ownopen()/write()against host paths (e.g./content/...on Colab) on the Python side, never insideargs.
import geolibre_wasm as gl
# Discover tools (each manifest carries a "source": "geolibre" | "whitebox")
tools = gl.list_tools()
manifests = gl.list_manifests()
# Raster: compute slope from a DEM
dem = open("dem.tif", "rb").read() # read from host disk
res = gl.run_tool(
"slope",
args=["--input=/work/dem.tif", "--output=/work/slope.tif", "--units=degrees"],
input={"dem.tif": dem}, # -> /work/dem.tif
)
assert res.exit_code == 0, res.stdout # surfaces tool errors
open("slope.tif", "wb").write(res.files["slope.tif"]) # key is relative to /work
# Reproject (warp) to a target EPSG
res = gl.run_tool(
"reproject_raster",
args=["--input=/work/dem.tif", "--output=/work/wgs84.tif", "--epsg=4326"],
input={"dem.tif": dem},
)
# Vector: GeoJSON -> GeoParquet (Hilbert-sorted, bbox covering, ZSTD by default)
gj = open("cities.geojson", "rb").read()
res = gl.run_tool(
"write_geoparquet",
args=["--input=/work/in.geojson", "--output=/work/out.parquet"],
input={"in.geojson": gj},
)
open("cities.parquet", "wb").write(res.files["out.parquet"])
Tools that write a directory tree (e.g. raster_to_tiles) return nested keys:
res = gl.run_tool(
"raster_to_tiles",
args=["--input=/work/dem.tif", "--output_dir=/work/tiles", "--min_zoom=16", "--max_zoom=18"],
input={"dem.tif": dem},
)
for path, data in res.files.items():
# e.g. "tiles/16/9559/32767.png"
...
API
list_tools(wasm_path=None) -> list[str]list_manifests(wasm_path=None) -> list[dict]run_tool(tool, args=None, input=None, wasm_path=None) -> ToolResultToolResult(exit_code: int, stdout: list[str], files: dict[str, bytes])runtime_path(wasm_path=None) -> str— resolve the runtime (explicit >GEOLIBRE_WASM> cached download)download_runtime(dest=None) -> str— fetch the runtime ahead of time
License
MIT
Release files for geolibre-wasm 1.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geolibre_wasm-1.5.4.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geolibre_wasm-1.5.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / geolibre_wasm-1.5.4.tar.gz
| Download URL | geolibre_wasm-1.5.4.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32c413b67ab4c841198b9874ba5ccf53cbc05eeed2197ad374a62810bb73f000
|
|
BLAKE2b-256 checksum How to use checksums |
73b01858bdbdfc79436224a868cc2879017bd4cdebce5d615b59563042afa1d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / geolibre_wasm-1.5.4-py3-none-any.whl
| Download URL | geolibre_wasm-1.5.4-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c72de946432470edd775fc0d48ebb1b2ac543a38eca424c3d19e4e4b29606476
|
|
BLAKE2b-256 checksum How to use checksums |
2ac3f872486f2ded93832861c0ff0ec2b4fcd0442e657a609eb02f0814826a9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log