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

Uploaded CPython 3.13Windows x86-64

rustwx-0.5.9-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.9-cp313-cp313-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

rustwx-0.5.9-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.9-cp312-cp312-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

rustwx-0.5.9-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.9-cp311-cp311-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

rustwx-0.5.9-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.9-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.9.tar.gz.

File metadata

  • Download URL: rustwx-0.5.9.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.9.tar.gz
Algorithm Hash digest
SHA256 60d0e5e07c96ea0802cad4c6c5fa319f88a9baf2f3349006a41462ea5181ac00
MD5 42b54682f03357b26728b3ed10b88291
BLAKE2b-256 a93d31d5ea11551a125bd59edf4f9c6e1b3d2ebbe5a39a16e97a97278be8cbac

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.9-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.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c5d8aefa65b2662a528cf1b701d87fc927ca5c68149313327b69be41c7b4689e
MD5 055e810b3bdbdbfa969f8a008675a843
BLAKE2b-256 d2dbbdae3707ea1ae1b87d678a7efa2dd7eead2643750d9f790d510a015b72f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 01836dade2686f772ed5ded55ba52e82d9e209799f7e941f2df9a5b31d9fa9d9
MD5 12d47dcd8a223bdfbac9415ae470f173
BLAKE2b-256 14d1db552baefe198f959e7138aa4ad999e3ed43e1b5a330be9fbfb415589eed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a4e21b50996018bef50ce1334cfad1120711cb4b93a7c7a1afdacf1d38ebb48
MD5 3cecedbd671154f9c0c02df1e0945995
BLAKE2b-256 e3f45a70abdafe4a50fe3c56418436ce22511b7f4b13eeac51767187d7d264f4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.9-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.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e84d791fdc2c9c56e0251c8d60eb97508278cb2d76c79b33a9e322127f7a74c1
MD5 ffc9921dcbcbb2a2642364a305494fd1
BLAKE2b-256 5ce9d41c9155c5571fd346d9592228c6b223e4d4e132374e2e3968731e50e8e9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f65056ec167550a6c80b6d8d510648b8fc483ed199e8f71b0bfad73aacaed064
MD5 9c1137f72b7356ac50f67ebd60807bd8
BLAKE2b-256 536e4d22bdb44894fca336a3191d32f35a4eb93b5029797fc9b2096b9d47be41

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a7f93f856c7d0d0a718d0bbc62708c2d93819a66004860b752d247a78452936
MD5 f89629713a9ea66c9842f929357e359f
BLAKE2b-256 79339b316eb1462ae9690adcef3de1d0a82ec716cbfc25753a227a2b2cbb11b7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.9-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.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d33a006dd71678938195e47a5b92f0f33cdacaa30a76161fe3b298327ec60eec
MD5 0df5e06f633bcf680689578c464e3680
BLAKE2b-256 d9aa994129c9e6ae47e3642c51d4cbdc5c549762ebf5395db21afc20d4ba14b2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 5fa0a56b02d6781694ea85229237ddedff07872e1ed7e82f2cbc9a0a8e740d20
MD5 4c7a502fd35a5f1adf56174801147237
BLAKE2b-256 5b04c02090c010097aedcb7601e4aaa62d2aa6d43b82f0d307e182045769ca0e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f20edd4465227501222d8871ea145fff83200d7b167c4025d4d8e9aa42522161
MD5 ac3318efed9c2f56cca8a700520cbc2d
BLAKE2b-256 2ed0e5d0d7b6971bbfdacbe3944c94cd2cf876ff7638906f797955d68cc1c76a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.9-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.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 18b6751305e27abb4bb88759ed3609963a5a929408e3d3226091aa9fcd5a5e33
MD5 24f1f68b3f491cd95c90a86099eddf19
BLAKE2b-256 27e5216e3bebe2bfafdceb3972f701579715f6787f3c9d38085651b8d93a82cc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 5d4856d52692f09cd42ad6b0ddad15900b44820ccf484a6ad3c2ab5da3769302
MD5 6e3d97f6f7c9370d099e651dd6317f3d
BLAKE2b-256 4ab45cc055c786c57c6cdb379f28fb14d59a9cfcd41ae7cd13a4330d6d09efc3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb98a4cdef39117026f8262f38225c2d89e34196fd652f33bb2be309770030c5
MD5 afa04c796172280d250fe59911d0e1a8
BLAKE2b-256 526a01f7b7b32d6d95eb6e40656eadc1e7041e85385ee5bbcaf7cfa542fa0bc2

See more details on using hashes here.

Provenance

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