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.2.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.2-cp313-cp313-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.13Windows x86-64

rustwx-0.5.2-cp313-cp313-manylinux_2_39_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.5.2-cp313-cp313-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.5.2-cp312-cp312-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.5.2-cp312-cp312-manylinux_2_39_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.5.2-cp312-cp312-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.5.2-cp311-cp311-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.5.2-cp311-cp311-manylinux_2_39_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.5.2-cp311-cp311-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.5.2-cp310-cp310-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.5.2-cp310-cp310-manylinux_2_39_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.5.2-cp310-cp310-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rustwx-0.5.2.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.2.tar.gz
Algorithm Hash digest
SHA256 93ebe2bc8d11146442a306c029ee2de70f1fd750d1420663e0f35a92e98c988b
MD5 88118cac04cd3cea50abd634fcb3665a
BLAKE2b-256 06e9f43157a683c845136243da74cd3ee25ac4549398bb2b127a96eda76fa680

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.1 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 37a54909c4ca89f2951dc06cbebe5f73ecbbb7ffe276010a23404785fd4b0e36
MD5 f6f3be3add15f6c365c99f22695cc444
BLAKE2b-256 2ad0247e6847d2407e0a90d4beaface9ed2ccd9b9e1fd64ca8eae2d5e4b91d6d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1d8bcd832e7927273245211e542a67efe4914b0ee111af45be6741fa35daa65d
MD5 1c7dfcb854484f67a544bc466b576427
BLAKE2b-256 a524244edc035df4067cc0e10649185011578c89a4c37638a873624ef8720f10

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bfaf0ea3b387cd5bd0d13e2ec1023fd68818f31ea251a0ee6e7db97797575606
MD5 3d3d1dd14cdb9ee0a0f6d95db86cf272
BLAKE2b-256 9244b0d3df2d62dc498d5f2ab69d104e4cdb50d1d2f7e8854ae40dfee3044f5d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.1 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d367b3924638591651ad01724f9829361be35460cb50740f88c8de6e11acab72
MD5 186132f0aae797ba633f6c66ecc1eda2
BLAKE2b-256 379a46163878db1b0b4c4c8703df98a14fd328e6050ea61ef44dd4a3d477a34d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d0f90a7e778d4da89093f95e9a098b4273c1d9dc215a2b6f13e906d515965c8d
MD5 2130275ba15c7bd23efd7b9e64c5237d
BLAKE2b-256 feb1d64b3bde0896a5259eff2e42046d389e9cee2ff04d07efddf1a621b292c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bec3d28f81c69e80e013ae60cca02b7a3d4c2a284cabd95fa540abd4eabb5648
MD5 82cccda5f6c1fb6e6c7bf0abe8c0a880
BLAKE2b-256 2207158df923053d335238fd975154d39980e96abec61e5979d606f96683f6e5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.1 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 420bfc46e195b5687ded782b141db3142f91f409d59f153f39151b63ed0b0d53
MD5 af4a5f3669db12e674166db3e31440c5
BLAKE2b-256 fea279f7e602cd34076902aefb2c470ae9d0d59cee48079d462912491736d1e3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 182a0b286cb485a380fb093e769de7fc3c04fc41e23e55e35ce198fcb95ef249
MD5 60811de9333de0722d922169ececcda7
BLAKE2b-256 5e2f70c4af98efef5b57560b8d1cc32f0dd8abc62c75551a70e1c11e1c6ba1aa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a01fe833a4923df8949eed8603b382689453108ca56070207e55279d194c1e86
MD5 f06946595ebae572fd9b3ed9519c0a5a
BLAKE2b-256 d1afb081cb4bf418ff508570087d1877a7dd94924783dac0a5fef77dd58a42e6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.1 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cbb40245a276c11cd384e5fb73f300c659200f18c59fbc63ff8e5f622633b269
MD5 3f545fe10d9504d737614b6491c2ee5d
BLAKE2b-256 a2133515657bd2d24527ba0c2da1d137c52e1124d50eb575f93dd073de60b01d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f3bfe4b98308fcd60a97ccc62489333d65ba96ae423cbd4bacb8c979ac0a178a
MD5 3e8bdfaaeae42eabc81ed07c259b9f13
BLAKE2b-256 e906d10a4e8d0f9b4261407f46db5b954d550023ebd02ec630b921b613941d5f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc83e232c589b65ac8be189682cb6e613c671fcd45988cb72d61db10182aeeab
MD5 4b180f60cd7b391335e46af900e8c679
BLAKE2b-256 ae63837caccbe0e0a341704f8cc9f68d9095297ae42f9021584885c68a56c232

See more details on using hashes here.

Provenance

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