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

Uploaded CPython 3.13Windows x86-64

rustwx-0.5.4-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.4-cp313-cp313-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

rustwx-0.5.4-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.4-cp312-cp312-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

rustwx-0.5.4-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.4-cp311-cp311-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

rustwx-0.5.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: rustwx-0.5.4.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.4.tar.gz
Algorithm Hash digest
SHA256 a7e2bf3998bb781a978731fb4415f9006e8597f8e0746928f4fef7f6a8683e4a
MD5 4139ab1ad1cf9ac074b737f8983ef5a8
BLAKE2b-256 9f08c78142d8605e0e00a4df61c2b854ef79fa6c3f9f9b20c8388af951c83d2f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.4-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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 604d169c1fa03d89629ea98bcfd600ef2eac4549a443d80fa62c228de6d016ee
MD5 d67c612a187d1237c4f65e45ff354c8a
BLAKE2b-256 f10d538175ab3216612117f4f1afa0d6b2a10f9208393109c31c11f82d7de237

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c60d1a51397f0de2c3ec3a45900dde13e4ad23861083323c294dbef8486038da
MD5 da2b3ec3fcef518ec2fe6166f2fd6348
BLAKE2b-256 b49e15b3130db31325a661ff1dacc27cb633fb7b99ecc86aba07064081f9e86e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5cb09b5bd7250841b57b6b68a5be7629ef3476c2ccd337187a025f33da5774b0
MD5 231a9e4fd2d8baa91a6bee71f8300416
BLAKE2b-256 bb79d04c6bed0613703e77791b086e4364e892fb44179c26a34046f1f8ee991d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.4-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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 01a34afa863a301ccb4eb0a0b51b6dfc87b376c23b68d0da0cceca9da1fe2e64
MD5 a6329bbcc95aac848fd0fdb44336afd7
BLAKE2b-256 4088089df35f8f46adeece6394be9a225524c6202bd32e4d5b421eafd8ff0138

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 02fcbbab7fa33db78c93cc106ebe487488ee52ec5f2054733a4b8a5e7a3f60c4
MD5 a185a30d55d195b7b5a6e3e0c790989c
BLAKE2b-256 3db082cbeb47cd65d51c3b2b554addbc6d33d2434a7cecd5a0abe21493fbe46e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2cea27ea6fddf4ebe695db27f56bf20ab439052d962c1f5b6a783385acb17b65
MD5 43ed1bb0aaa4e1be18e2544348611dce
BLAKE2b-256 e0052e4d871091bffc2d056ebed431170a683f1d779856f48ebc6ade54918368

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.4-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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5062b418623f5e907043dd9c86171253b541dc302d71b94da31e26c334e23a8c
MD5 59e82dd27a2cf5ee3d6ebb88d5de3c96
BLAKE2b-256 5417842f53a1c443901a81f0c6621ba76300bb1423bf23f32f5d9237dd884cbe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 75561be161b40feabae447301fa55d412b9fa4066cbc01c2f41f56c9010f69f7
MD5 bcef4a6e129d2e3f6adf7ee8654aa60e
BLAKE2b-256 5d1af3f2d1f7709368f74e392b11083dbf41def0f73bd9243858d56382ffc99b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 758f2f166ecadaac4c39f6d8df8967f614c40148cfb95de816c0a88d21f5edcc
MD5 4c58051affe96c55cac0790934fa4735
BLAKE2b-256 74f18b4c5460a2aec76f0cfe0616b444cc48ff2f1eb4e9ebae45ccc997a04a0c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.4-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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 afb56c2aaeccf3a7a80adda6968398de922e862d353828ecf440c17adbf6b17a
MD5 a71d06db1141be978e0fcb4a91314825
BLAKE2b-256 4dac0e53f59a246f366aa3f4e403779571375ddf5fcc0d3e28597ab1855c28e5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 abac85576556ecf6b312cc4838aee6856b5b8f6d011bcb42521e80205815683c
MD5 2a3bb7cbad093967ba47d48c251f8ba8
BLAKE2b-256 cb78cf2047bbe1879ca1e6210ca8eb1da083e8874f8b94ac0e1f33530af494e6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ce4027e41b92bdb854820037fc24b135a8fdf3b6d0443a0864425fe96f2db545
MD5 0df0a3426de7b87d02751329d01c5e3f
BLAKE2b-256 3b7d587d7b9081a17025ee1cc451fa048ed26a5a8c78b8bfdbfbdd0a52d21c70

See more details on using hashes here.

Provenance

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