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.4.6.tar.gz (1.7 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.4.6-cp313-cp313-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.13Windows x86-64

rustwx-0.4.6-cp313-cp313-manylinux_2_39_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.4.6-cp313-cp313-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.4.6-cp312-cp312-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.4.6-cp312-cp312-manylinux_2_39_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.4.6-cp312-cp312-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.4.6-cp311-cp311-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.4.6-cp311-cp311-manylinux_2_39_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.4.6-cp311-cp311-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.4.6-cp310-cp310-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.4.6-cp310-cp310-manylinux_2_39_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.4.6-cp310-cp310-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for rustwx-0.4.6.tar.gz
Algorithm Hash digest
SHA256 8198483bee2a89567c1f3e11f593fa05803b544c91ae58aa8f1a5d87a72259bc
MD5 4998b83fad43d2cae40c2e2fb7cf8ff6
BLAKE2b-256 0b1e14bd074cba2668497d867c26c387a61c042cc76b037490533271047ef2ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.4.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a4c9031e78ecbd3122ca181b558c0c4e7914e3b0a3c5288893d15b9101adc9ab
MD5 0d6ef5818138d7bafd7dea744dc7bfed
BLAKE2b-256 94ce3f007db7263ebfda18854ae722c3cbd4136ea8edb14d4a2cdc3d25f7def5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 89e03122ad8c3ad9afe54a03ed8aea002688bb6f7c3a8fa678d22f6a10791e25
MD5 9ad719334a71398f043803cf20afaf0e
BLAKE2b-256 3fa70900d71cdf93f4c7eef42f38e4a9f98a48544411a2c3b272fe5fc7ed8018

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45c8c60469927353e6f747b4937bcb6e4494485914101c1315e8072574b64f39
MD5 4f3447681a930f444f4b0db734cd5231
BLAKE2b-256 2c51dc25af70e0c43e28813edf93ceedbc785f5b0af4fbb5ce51cd8dc179d0b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.4.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 784cf280b55d75fdd5cba2851e8e4b269b02290c1def36ecec53cc055d8694ad
MD5 92b7d40e9e24ae6daf7f2f3e19b9b714
BLAKE2b-256 555711efbb58e1bde97142babc6cd9e18bc713c04d92a8e28881503dde4c4c25

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 beaf6dd5c9560681ac37a0eaba2af75b260beef49f8f33dbdf9912c7f794eb48
MD5 6f6798172acc11e246f0566763fb9f93
BLAKE2b-256 e25afbae947871ba1af72dbd9d496ee7ad9bda8337890c2262f4f1007285be36

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4f6e27e1f44cb691ab7b75990a9aee7f6bb2b037b48f3e75167d10b680cdc9be
MD5 8d20f396b3e9afb6077cf58d0d04c885
BLAKE2b-256 0af5c493708d3792a3f8eb2b695f410d4185e6de68df39de6983ae9df19b28db

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.4.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9cd34472d17a899922bbc862f31ec4418ed60124ee132593148170b3099b72de
MD5 53df870810459d04b53850c2b69ccf0d
BLAKE2b-256 1edd1b91dc32d0e1afe385ab8762ef6184f2c4d737a24f976d24c77c165cda23

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3f224afb5d9917f2b7bf1f57b4d8ce6cb168a86bc8e334f0b5c9483361c21649
MD5 b5ecd98412928327b9c1b167b70d1e40
BLAKE2b-256 fc12059d78149912fe44369068c07348a99a0786e46795f6bb451706accefc1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6fa286b4af28c39aefe2bbd5364ab0bd9ff4793273c0a4dfcd7bd47b27a9713b
MD5 c487cacc98b9c00cae7db7279e62a371
BLAKE2b-256 1c1d973fd0a1e5a60cc926738ce0206f5c8393135b45bd82fc81ce5f5bb973b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: rustwx-0.4.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f31a14fac74bab94274381b041b2a47484db478bef65636af466683376ae3ce3
MD5 a5575e0aa7bb4885d8e813979373539e
BLAKE2b-256 b6d0ee69a53ec47d9e2e0450420e8c00eba329aa60a64b80d2f20a1c9befcbb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c9049cf29ed41738ad57f17cb5de5f55decfb96b81594161c95bbd53a7e4014c
MD5 7c2b87b09c95319104a7a9d036314dbc
BLAKE2b-256 b81ed4e612bd37c3160cfb593dd06b960254dc21e37bbd4496742ad766b7f4d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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.4.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustwx-0.4.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89ea68db4b7e93c07fe9dc77c12f5f20da1cdf07a1136c073812fb094cd0d8a2
MD5 2602daff57b29e297497b0bd383d4304
BLAKE2b-256 93a9c77ac2b26a8a3723f951a9051d676ff7acbfbee4cf61f10e7a798ecf9f42

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustwx-0.4.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