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.10.tar.gz (2.2 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.10-cp313-cp313-win_amd64.whl (6.7 MB view details)

Uploaded CPython 3.13Windows x86-64

rustwx-0.5.10-cp313-cp313-manylinux_2_39_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.5.10-cp313-cp313-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.5.10-cp312-cp312-win_amd64.whl (6.7 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.5.10-cp312-cp312-manylinux_2_39_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.5.10-cp312-cp312-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.5.10-cp311-cp311-win_amd64.whl (6.7 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.5.10-cp311-cp311-manylinux_2_39_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.5.10-cp311-cp311-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.5.10-cp310-cp310-win_amd64.whl (6.7 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.5.10-cp310-cp310-manylinux_2_39_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.5.10-cp310-cp310-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rustwx-0.5.10.tar.gz
  • Upload date:
  • Size: 2.2 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.10.tar.gz
Algorithm Hash digest
SHA256 c2f6ca44ec6b388bb3a01b693033ce554b71ba7fbd5782d31944306291d73c12
MD5 38b3a9b9034b0fb9de94761025e3ed25
BLAKE2b-256 a95125a42e870c5ed166bb836e740e14948c9cfd7dce1fabaf6ada85db9d8b0a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.10-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.7 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.10-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 30003118a7a08153915ce5a7e403a887eaedb7e05c62e0d810f6e58cf905a0b6
MD5 1da23f7ea078908fc245e65c134c8e04
BLAKE2b-256 56cc54c4ec82832caa51be4931452192a57bfe0e01547e6f91307962d2bb5de5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d7db7e65e2ce8cd02495c1594baf12bdefcb45db3c234af929e2eedc0aad3648
MD5 d888b9628b2a2a28336074245712f944
BLAKE2b-256 b1660a90b68f3ede8c44deb8c0f915800d0f548d99503fb3e6fd8a377ee5a182

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5468e469e580d8a18d95d534bca79af3cfccf42a91ee7c2f2253dbde6b0a20d5
MD5 f4201ba3adb52420b0b26c81616cf39a
BLAKE2b-256 ab97f863881b168002f78430206476b97ceb1d3c7b2af4735af2f8fdf0c3fb44

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.10-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.7 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.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d21e5753197b0e2acf5c428b57ed9498bb48a9f1db8d1a2418db0b79eb97ee52
MD5 18632e6552086d474422ae999873259e
BLAKE2b-256 1437ebb58757bcc68b6e9b2896b2f5dd9471affbafcb37b002d7392d2a21e74d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f99595de1419d7462978bb597108536a1995d541d7e3c39b7109790937bcf758
MD5 b01646013aa7cc4adb8bd4b40da0de7c
BLAKE2b-256 4d27d6776bc3dc45670d5a0572f476e27d29e9544588826dfa6ddab6a86da16d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a6b41978496c759da6729ad5ca4f372ab850f8618c73efce3588d7b116371ac3
MD5 68d21967d53c6e21573ca3696463fb26
BLAKE2b-256 15de4acca6ddc5d6fa39bbdc8f3701066af1c24a302e21f77885b3fde4bf6cef

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.10-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.7 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.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0ffb7c09405a7afd078d8ea1f3e86249cca76f4a4ee7950e58902ca7084c6abe
MD5 5c3034e9f47de5d0333b333149d4bdbf
BLAKE2b-256 8e1ae6549cb19874e96e3e0278ae808f4d7e206ea01af6416e987edb38d55312

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3aff6da03f34890acdb174e64297ec49b728eea3753b3ff736c659e58da6c6e7
MD5 987201976ebc794c21bad1387a0b6d88
BLAKE2b-256 9132fd15f721a690e5ef24a6ef91866a2fd120e04a10665e8cfb1889bc192236

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 409ec522728851685b7679638db3d2499db152db05154585bc233bea7058a05f
MD5 9ff5af8743608181a363840b06af4e27
BLAKE2b-256 42411a36d69766dba38a6743bdc35b11dd4bcd5c0940fef9a000083b18038890

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.10-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.7 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.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bd9a7b46a2618486c01606b8ae84ec326cc666d938ef2af79969bae63370d864
MD5 3b451f91095ccb85110c355b780897a4
BLAKE2b-256 23dadabc1f579ac6b56d2cfaeb22f1b587d5a943177544f419a437f15d17392a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bc91c1996fe4fa8332b093307b89afaf78b812e67ab83a15b946fd0b8d4dc57f
MD5 2081be456509d1d2ecf0eb212b59368e
BLAKE2b-256 b98d7160125200aaf7de4b1db44565ba0a0f769f02973e2b4c874fc896919c68

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.10-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2125e55fb043a3cd3838aa3f95901f26b3669348ed10639f0be506d5ea8877d1
MD5 940d91aae2212329f79bb0c08a179a2e
BLAKE2b-256 e2a20a0f2fc09d08ec2efb784a72e516f7a2fb6963c997e40f7c31799231014e

See more details on using hashes here.

Provenance

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