AnyWidget wrapper for globe.gl
Project description
pyglobegl
AnyWidget wrapper for globe.gl with integrations with popular Python spatial packages.
Goals
- Provide a modern AnyWidget-based globe.gl wrapper for Jupyter, JupyterLab, Colab, VS Code, and marimo.
- Ship a prebuilt JupyterLab extension via pip install (no separate lab build/extension install).
- Keep the Python API friendly for spatial data workflows.
Roadmap
-
Near term
- Expose globe.gl APIs in order (by section):
- Initialisation
- Container layout
- Globe layer
- Points layer
- Arcs layer
- Polygons layer
- Paths layer
- Heatmaps layer
- Hex bin layer
- Hexed polygons layer
- Tiles layer
- Particles layer
- Rings layer
- Labels layer
- HTML elements layer
- 3D objects layer
- Custom layer
- Render control
- Utility options
- Prioritize strongly typed, overload-heavy Python APIs with flexible input unions (e.g., accept Pillow images, NumPy arrays, or remote URLs anywhere globe.gl accepts textures/images).
- Solidify a CRS-first API: detect CRS on inputs and auto-reproject to EPSG:4326 before emitting lat/lng data for globe.gl layers.
- Expose globe.gl APIs in order (by section):
-
Mid term
- GeoPandas adapter: map geometry types to globe.gl layers with sensible defaults and schema validation.
- MovingPandas trajectories (static): accept trajectory/segment outputs and render via paths/arcs without time animation in v1.
- Geometry-only inputs: accept bare geometry collections (Shapely or GeoJSON-like) as a convenience layer when CRS metadata is explicit.
-
Long term / research
- GeoPolars exploration: track maturity and define an adapter plan once CRS metadata and extension types are stable upstream.
- Raster feasibility: investigate mapping rasters to globe.gl via tiles, heatmaps, or sampled grids; document constraints and recommended workflows.
WSL2 Test Notes
- WSL2 UI tests require WSLg with a working display socket (Wayland or X11) and WebGL available in the Playwright Chromium build.
- If the UI tests are meant to enforce hardware acceleration, set
PYGLOBEGL_REQUIRE_HW_ACCEL=1before running pytest so software renderers skip early. - Canvas reference comparisons allow a small pixel-diff tolerance. Override
with
PYGLOBEGL_MAX_DIFF_RATIO(e.g.0.02for a 2% threshold) to tighten or loosen comparisons across platforms. - On WSL2, the UI test harness retries the browser launch with the D3D12-backed
Mesa driver if the initial WebGL probe reports a software renderer. You can
still set
GALLIUM_DRIVER=d3d12andMESA_LOADER_DRIVER_OVERRIDE=d3d12manually, and optionally setPYGLOBEGL_WSL_GPU_ADAPTER=<GPU name>to map toMESA_D3D12_DEFAULT_ADAPTER_NAMEwhen multiple adapters are present.
Build Assets (Release Checklist)
cd frontend && pnpm run builduv build
Quickstart
from pyglobegl import GlobeWidget, image_to_data_url
from PIL import Image
GlobeWidget()
Image Inputs
Globe image fields expect URLs, but you can pass a PIL image by converting it to a PNG data URL:
from pyglobegl import GlobeLayerConfig, image_to_data_url
from PIL import Image
image = Image.open("earth.png")
config = GlobeLayerConfig(globe_image_url=image_to_data_url(image))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyglobegl-0.2.0.tar.gz
(768.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pyglobegl-0.2.0-py3-none-any.whl
(770.4 kB
view details)
File details
Details for the file pyglobegl-0.2.0.tar.gz.
File metadata
- Download URL: pyglobegl-0.2.0.tar.gz
- Upload date:
- Size: 768.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd17170113e1543ca1f25d236612e960cf482bc1fa76235f560aad85b62c6127
|
|
| MD5 |
d52a1053071a83c58a65e61d28e86a42
|
|
| BLAKE2b-256 |
4ff51f191ba86051829aed328aa469cd49820d0df6355cdaad7bf36c11744b9e
|
File details
Details for the file pyglobegl-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyglobegl-0.2.0-py3-none-any.whl
- Upload date:
- Size: 770.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8097b810328e86f7e567ad745b6399fa282179b9c71cd175b87acd3c69153e89
|
|
| MD5 |
4838262f1aed611a56c3085c82f81bd2
|
|
| BLAKE2b-256 |
1143b87880e3da8f56198195517335d7d8e02f12f97c230faa2b63440eae3e21
|