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.3.tar.gz (1.6 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.3-cp313-cp313-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.13Windows x86-64

rustwx-0.4.3-cp313-cp313-manylinux_2_39_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.4.3-cp313-cp313-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.4.3-cp312-cp312-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.4.3-cp312-cp312-manylinux_2_39_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.4.3-cp312-cp312-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.4.3-cp311-cp311-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.4.3-cp311-cp311-manylinux_2_39_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.4.3-cp311-cp311-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.4.3-cp310-cp310-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.4.3-cp310-cp310-manylinux_2_39_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.4.3-cp310-cp310-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rustwx-0.4.3.tar.gz
  • Upload date:
  • Size: 1.6 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.3.tar.gz
Algorithm Hash digest
SHA256 5f338581c3ad064f52129136b3e8ec60584f7aaa0233cdd6dae1a490cc412d96
MD5 3ec468feb8bae5b029ed2746be304993
BLAKE2b-256 7f04c61fd9e5392e82a522c9e54453e3d8a010f96409f746eafc98fc4ce593f0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b6989397d20d02a38251d86b91ae7b874e242c2b44825809bb528dc71555aaea
MD5 a9f62dc612299854c0ecab141fbb6385
BLAKE2b-256 9c3fc7463a4208e1c4d55e080901821b3be05201828b6bae371b56f5eab844e9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 5400986bb45e28dc108f3202fd5bb0cd1fc6f2985dd13b5a439a878c43b7be51
MD5 54c5cea27a325f81f640d56fd7885dcd
BLAKE2b-256 c043fad39d58985bd00baacca441314340bd732fd820aa3f06f4b55fd597a7cd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2407c70c4bd489b27e00b5fb045efb197d063d5c13ee184302d469425d787732
MD5 fcb0b3d1dd5f5f0a0d97e3a9adfd78cc
BLAKE2b-256 0883c7136cdb01f3092ba7b029c3a47bad0ad19883a0ea12832c308d0fd0bee4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8b421271a04e1c3bfe640c6e06fc1d5495dbe276386e9482269181f77f04858b
MD5 1573129438bfdcd8dc32b6a841474164
BLAKE2b-256 f82969818d3b6ff02b6e5a8d14dc488351a8da50dd9f4966f066ea01e4a7b3e6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 34e793a32ac7ee42c3f53c2f3018088c0ff1992afd042dea8d951e95a02e1368
MD5 2fbf7248de4d0c09b93438c038305db7
BLAKE2b-256 c43ed486ffc50a50add126526149e559d0ff55063abd601ff7372ccb8db4b35f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d91fee555a38d2e910351cb9707c1bb427dc80385b88f6d83524b997edeea11d
MD5 dedccd2bee84f8c33a358077d5a0dd51
BLAKE2b-256 5af81d1858934e7bc56b58d87035e8d8e588837a06b532ce2a95eeaff4453d68

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 34e205a9e56b85ee87d0fac69b2fa4d0d45b836d98800b8150d35ddf28fc0ff6
MD5 44db784f1e512f7f7d21552652885714
BLAKE2b-256 290fbe4a351c822d1020f2717d3ab9bdb15b6d41ceaceb4762a09ade2205c5da

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e0f2ae7747cb2f4e1ff2cf9d0362e9799c3dd6147cdaba4df3a21cf07cf473c3
MD5 875febad6173e76db34b6eef9107580d
BLAKE2b-256 57f9c052b83e7730fe04237ef68a672ccdab212853977fa4f3aa78c155d3afd2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1eb201835341df57216530f815d8909093d49d39c02e7e58b0d853824ca81e81
MD5 b53a2fd069da371ecdc0a3a64822f5cf
BLAKE2b-256 29d93d7a47d8897a103875bbc5ee94ad71a121d821dbf2f59425da38e88fe7a8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 98f4d8ac3daebe13406a1e5276410818e661992823950ccce79fb6f87f4ffb22
MD5 4267d0c36e9506cccc4590e8f5a4ccaf
BLAKE2b-256 8355b99142add6e7795943d134eea30c2b1997b81a74c913c4c7f4b358b50062

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8a38baa8dcd1e98048c167f9199fb53bb40abda51548ea28747440bc97b56966
MD5 b14d17bdd54e8c981b5e336e7a57c173
BLAKE2b-256 f6d51ef3261dbd89ecbd303b0716a84029c3a7407e1af23b2154f16a0b37aecf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a7f3954a0f397037ac0365fba06712ddeb9fccf93cddc1e17099c91ce3d332b4
MD5 9748c9725436c37e6086bbfbbebdbaef
BLAKE2b-256 bf8250cad2c0e42b19690de230f4e6125e7dad0e38a5d9b44854f59cdf2bd62e

See more details on using hashes here.

Provenance

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