Skip to main content

Rust-first weather model metadata and projected map rendering bindings

Project description

rustwx Python bindings

rustwx is the optional Python binding package for the Rust-first rustwx weather workspace.

Design goal

Keep Python convenient, keep the hot path in Rust, and expose generic render/model metadata surfaces that are usable outside WRF-specific callers.

What is implemented

With the python feature enabled, the module exposes:

  • agent-facing discovery and map rendering via agent_capabilities_json, list_domains_json, render_maps_json, render_glm_lightning_json, and sample_point_timeseries_json
  • model listing and source/model helpers
  • projected-grid rendering via render_projected_map and render_projected_map_json
  • compatibility aliases render_wrf_map and render_wrf_map_json
  • standalone projected projection metadata via describe_projected_projection
  • standalone projected grid/layout metadata via describe_projected_geometry
  • standalone projected CONUS basemap overlay extraction via build_projected_basemap_overlays
  • future-facing cross-section request validation/normalization via normalize_cross_section_request
  • native sounding-column rendering via render_sounding_column and render_sounding_column_json

The wheel also installs a stable rustwx console command for agent and MCP adapters:

rustwx capabilities
rustwx list-domains --kind country --limit 5
rustwx render-maps --date 20260424 --model hrrr --domain california --product 2m_temperature_10m_winds --out-dir out
rustwx render-lightning --domain california --data-dir C:\Users\drew\lightning-test\data\glm --out-dir out
rustwx sample-point-timeseries --date 20260427 --cycle 0 --lat 40.802 --lon -124.164 --forecast-hour-end 6

render-maps accepts mixed product slugs and routes them to the appropriate direct, light derived, heavy ECAPE-derived, or HRRR windowed product path. Heavy ECAPE slugs such as sbecape, mlecape, muecape, ECAPE/CAPE ratios, NCAPE, ECIN, and ECAPE EHI/SCP/STP use the canonical derived_batch ECAPE path; they do not require callers to discover or run separate binaries.

When cache_dir / --cache-dir is omitted, the agent API uses a shared rustwx_outputs/cache fetch/decode cache, or RUSTWX_CACHE_DIR when that environment variable is set. The cache is intentionally independent of out_dir and map bounds, so city or bbox sweeps can reuse the same upstream GRIB fetches while writing PNGs into different output folders.

MCP servers should call these stable Python/CLI entry points instead of invoking internal proof binaries.

render_glm_lightning_json / rustwx render-lightning reads GOES GLM OR_GLM-L2-LCFA_*.nc files, renders native Rust projected flash maps, and writes a JSON flash artifact with lat/lon, time, energy, and area fields for agent consumption.

sample_point_timeseries_json samples native model fields at a lat/lon over a forecast-hour range for meteograms and point-and-click agent tools. The default variable set is HRRR-meteogram ready: 2 m T/Td/Tw/RH, 10 m wind/gust, hourly and accumulated QPF, low/mid/high clouds, MSLP, VPD, HDW, and the fire-weather composite. It uses rustwx's GRIB/idx fetch path and shared cache rather than cfgrib/xarray.

Every new projected helper has both a Python-object entry point and a _json variant:

  • Python-object entry points accept either a JSON string or a JSON-serializable Python dict
  • _json entry points keep returning pretty JSON strings for low-friction interop

Projected map API

The projected map surface is generic and public-facing. The caller supplies:

  • lat, lon, field as numpy.ndarray 2-D arrays
  • a render spec with product metadata, color scale, layout, and projection metadata
  • optional contour, overlay, and wind layers

render_projected_map(...) writes the PNG and returns a Python dict with:

  • typed projection, extents, layout, and layers sections
  • legacy pixel_bounds, data_extent, valid_data_extent, and projection_info keys for compatibility

Minimal example

import rustwx

print(rustwx.list_models_json())

Point time-series example

import json
import rustwx

report = rustwx.sample_point_timeseries_json(json.dumps({
    "model": "hrrr",
    "date_yyyymmdd": "20260427",
    "cycle_utc": 0,
    "source": "nomads",
    "lat": 40.802,
    "lon": -124.164,
    "forecast_hour_start": 0,
    "forecast_hour_end": 6,
    "variables": ["temperature_2m_c", "relative_humidity_2m_pct", "wind_speed_10m_ms", "hdw"],
}))
print(report)

Projected render example

import rustwx

spec = {
    "output_path": "example.png",
    "product_key": "Example",
    "field_units": "dBZ",
    "scale": {
        "kind": "palette",
        "palette": "reflectivity",
        "levels": [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70],
        "extend": "Both",
    },
    "projection": {
        "map_proj": 1,
        "truelat1": 30.0,
        "truelat2": 60.0,
        "stand_lon": -97.0,
        "cen_lat": 38.0,
        "cen_lon": -97.0,
    },
    "width": 1100,
    "height": 850,
    "basemap_style": "none",
}

metadata = rustwx.render_projected_map(spec, lat, lon, field)
print(metadata["projection"]["kind"])
print(metadata["pixel_bounds"])

Geometry and overlay metadata example

surface = {
    "projection": spec["projection"],
    "width": 1100,
    "height": 850,
    "visual_mode": "filled_meteorology",
    "basemap_style": "filled",
}

geometry = rustwx.describe_projected_geometry(
    surface,
    lat,
    lon,
    include_projected_domain=False,
)
overlays = rustwx.build_projected_basemap_overlays(
    surface,
    lat,
    lon,
    include_geometry=False,
)

print(geometry["extents"]["padded"])
print(overlays["counts"])

Cross-section request normalization example

normalize_cross_section_request(...) does not render a cross-section yet. It validates and fills defaults for a future shared cross-section API surface.

xsect = rustwx.normalize_cross_section_request(
    {
        "path": {
            "start": {"lat": 39.74, "lon": -104.99, "label": "Denver"},
            "end": {"lat": 41.88, "lon": -87.63, "label": "Chicago"},
        },
        "field": {"product_key": "temperature", "field_units": "degC"},
    }
)

print(xsect["path_metrics"])
print(xsect["request"]["axis"])

Current limits

  • projected rendering still expects caller-owned arrays
  • cross-section support is validation/normalization only in this crate
  • render_maps_json covers model fetch/download/render orchestration for direct, derived, heavy ECAPE-derived, and HRRR windowed map products
  • sample_point_timeseries_json is a point data primitive; consumer-specific meteogram styling stays outside the Python wheel
  • sounding rendering expects a caller-supplied validated column; model fetch and lat/lon extraction live in the Rust CLI for now

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

rustwx-0.5.6.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

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

rustwx-0.5.6-cp313-cp313-win_amd64.whl (6.4 MB view details)

Uploaded CPython 3.13Windows x86-64

rustwx-0.5.6-cp313-cp313-manylinux_2_39_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.5.6-cp313-cp313-macosx_11_0_arm64.whl (6.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.5.6-cp312-cp312-win_amd64.whl (6.4 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.5.6-cp312-cp312-manylinux_2_39_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.5.6-cp312-cp312-macosx_11_0_arm64.whl (6.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.5.6-cp311-cp311-win_amd64.whl (6.4 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.5.6-cp311-cp311-manylinux_2_39_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.5.6-cp311-cp311-macosx_11_0_arm64.whl (6.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.5.6-cp310-cp310-win_amd64.whl (6.4 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.5.6-cp310-cp310-manylinux_2_39_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.5.6-cp310-cp310-macosx_11_0_arm64.whl (6.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file rustwx-0.5.6.tar.gz.

File metadata

  • Download URL: rustwx-0.5.6.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rustwx-0.5.6.tar.gz
Algorithm Hash digest
SHA256 b9215c15537a43a06ae9451c4ac40b2d49166d7344831833f7c1b52234ea90f8
MD5 9eed475f62ed34c2ac3d74f7617512ce
BLAKE2b-256 74e86f1b5d25faded44c9b9f7a0284c774377e24de3bce019e2b1d483d753027

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6.tar.gz:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.5.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rustwx-0.5.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fe5da14d20cf34ceeda5ad97dd8bfd8cf000e0f5c9d13b37c3757ea02f47644f
MD5 daf18ca11f9439175bbe4765a4000fbe
BLAKE2b-256 4054763cd66a4e6fbc34cf87cd5dd6c5a903ee156f8cbcfc8a5377b7c2afbb01

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp313-cp313-win_amd64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 24989c0089cfe2f8355a3492e93901bc74a45d59580fd49c00fd0bbe60faa147
MD5 e70dd742a4c42deafd76c1adcd918660
BLAKE2b-256 b694ab9ddf4d8afe8709b76e75891b3226933055c9e2528d60d232220250c92e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp313-cp313-manylinux_2_39_x86_64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 404e5cd01b4ed009b80656f14e3cbab4984a0aed380a9eda1d92ca115114e453
MD5 bb3542ef5ed75ae300eccfc5d9d5f523
BLAKE2b-256 6369b29224cb04c0514628c1ba7b42bd0decab3b18d25070a43268019f8421d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.5.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rustwx-0.5.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5db2286c9b01c492a338dcf659060a8c475bdd09e25a89b06324e6e0cca112f4
MD5 b14ada469ce47e6692aded04588d693d
BLAKE2b-256 e310ff0fdb26489474d0d734b7f60a04583b0861b66848aac3c47c3cc3b0b7af

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp312-cp312-win_amd64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bb0cd0f7751b9f62e2df7f66469a8916821a1b99927e30e3c3779cdb124a67f8
MD5 79ed8ac8d993d9fbb323ea4c90364e26
BLAKE2b-256 aadc802791984f8801c455cc454063747f17c37e644dca36b7044f8232b27c53

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp312-cp312-manylinux_2_39_x86_64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22146b9b50199c6cacd3fdc077e442e0e4fb268c9f2ff4321b8f770b00cc02d4
MD5 a7e05ff85ac546c0d6c6e2e49919b508
BLAKE2b-256 6c34803b78f1e2abfc7592298c8e22a6f42b01476eaa14ee88e05ec0ed13c856

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.5.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rustwx-0.5.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 24fa792f285b8130f19bdc1c19732f5d30fb804b6c21a369110cc6dd14e9f60e
MD5 f8da2aa024c09ba0e302f063ea8ffdd4
BLAKE2b-256 bebbc83b733d1a8409568053cc036163608303fc20e1aaa3450adfa689aad220

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp311-cp311-win_amd64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 29d9309bf3726e56534fd9bf5187a82179af16ba8e2cecb439492be8388820d9
MD5 f579999059efe2e030f59f2313e0654f
BLAKE2b-256 4c522a9369913b312bd40ee0250a9a7e119d5a70d8b1c57955fa99b40ed31403

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp311-cp311-manylinux_2_39_x86_64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3135e71171743b7a44555072035464b38a581445a79d2d71522ea054cbb72088
MD5 b2ceea6f997683c3fc25de971d6ad69e
BLAKE2b-256 ca1bca27789c8edbb833da785b26ca082e3deae99a0654adee04e37ff2a19c3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.5.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rustwx-0.5.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 85c9de7356f4ceb2d9b4d99084c5d16e4682deb3d6553b209cf9e28a0e408fa1
MD5 b45ef78eb3d3dc8c93bc2b847a5802df
BLAKE2b-256 8dcc2f142f74e418e5c3bb110a1692b92369f876cfa90795f0f1d40c2053ef4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp310-cp310-win_amd64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1d31a4423a493913eb8203c9bcf2d0ac9e51e5002216b2f42e7efc5803c3468d
MD5 97b1730d5704262e0b027bcc8aec6429
BLAKE2b-256 e9c3357909916a92ef7450f7f24a629d007bfbad3c32dc93b3b8789d713b459b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp310-cp310-manylinux_2_39_x86_64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

File details

Details for the file rustwx-0.5.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.5.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a983026f9af5e7092f5225ba7bc62f4da8125f18634d8420eb215bed8b1ea62d
MD5 52f8780184e211a00bd9eb4749721a4c
BLAKE2b-256 b04cd5bb87acc161751dfd418ba87395b16a044b1f753a1d4dd6e1e7f1c54993

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.5.6-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: workflow.yml on FahrenheitResearch/rustwx

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

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