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.0.tar.gz (1.7 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.0-cp313-cp313-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.13Windows x86-64

rustwx-0.5.0-cp313-cp313-manylinux_2_39_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.5.0-cp313-cp313-macosx_11_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.5.0-cp312-cp312-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.5.0-cp312-cp312-manylinux_2_39_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.5.0-cp311-cp311-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.5.0-cp311-cp311-manylinux_2_39_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.5.0-cp310-cp310-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.5.0-cp310-cp310-manylinux_2_39_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.5.0-cp310-cp310-macosx_11_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rustwx-0.5.0.tar.gz
  • Upload date:
  • Size: 1.7 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.0.tar.gz
Algorithm Hash digest
SHA256 60fcd2f96c30e4f5e953478da1afeea44e31dca938b8bed7d71645221acb657e
MD5 f3300217af77cf62632ab917d2e9d1a7
BLAKE2b-256 48e84d52f33068ee40fa0a52e175ca6e2ff080cefbe0254778da90f9f8580b47

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 66ef9e6f5f68ab8324256c51f64f8c0189d60f046790cdc631ece8c3618208df
MD5 c592caed0ccbca36a7d87865d98c5bd9
BLAKE2b-256 568bfe2c55946ae00f93fa011b7b660b99529ae7f202bd600b6a95940dbe9d3e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 90fd888db31824a0a910746323e8fd3f1851bdc1ede8f8aea3f1f67555f924a8
MD5 cc493c4a0475aba20f3663d6342edcf9
BLAKE2b-256 22aa739bad8b77f1574cc7a2d354af24c0db3ab7ad76d019d9d987efa66ded70

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a5c8b007f34fe83c86d9810d0f10c91ef1008b19cd099c50e2726fbeb776fdc
MD5 b2aaf802701a028bcc206826d438d823
BLAKE2b-256 505ef90e914c73d7c596f1f8c95da29dbacbe0183612bec5606f88a2bbc7abfe

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 96ee5b223c509b8cac308343bd9b9550cd7cdbe748eca3aa270555512fc75a95
MD5 c4c33a051f05f79cbe3bebcd7a77fdff
BLAKE2b-256 7f37283e2016c85f63b999c9154358ea97ee5fd7b42e9c4d3a4698c0114f5b60

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e2a1dfbe595e45f9d565851753fcf1303bdfba022a07a984895014ee0d99af78
MD5 b8bd8ca96fa30d6c98b5824d5a9ea57f
BLAKE2b-256 ea5a7831471dc7579a25766cf1b8a0a9c4c8b32ba11b1d7c54b1615575bdf443

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4104d51944a19a5ae87b111f5b57337dc495240f908e7ef2dcd4ecffe0e1009
MD5 019c6931d80b3251523add83a74cf604
BLAKE2b-256 8c403b408a7f72f0d2046e6534e5f8f75f3cf426e68471b107576e5200438f5f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b4235a9c336f9ff95897c13a41728ead99019086b487293a66d0e89ec6f68ab7
MD5 053d666d946b0563fe696ab5ae583c4b
BLAKE2b-256 3450b384ada36b1939af05438973ab4063571261f11c37b3fb02c7fe840f067c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e013600cb1d03eaa43156f9b50f834d42be845fbe9b38181663d09b7e98f3978
MD5 b1782601aa6903fd150e7c1c62c443e2
BLAKE2b-256 aa80dbfe260d3107ac6f3208688347686a0482eca771fcddc3658461b3ad899b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b9cd1b514dbdcf6a0c70f53ac8a80e567fb41a24aa71da508aac7afdbf719fb7
MD5 b7aedc9cb7e97136e5cddce053ff564d
BLAKE2b-256 44ee1aeb06c7a458b8dafb2ed15ffb5f3a0c0ede51ce446a8d5bd626c4187846

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 5.9 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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8f76d68ec5260a3d25e553514f69fe6f79a5469558ba3e196adf4bd684d29292
MD5 7f7c9dd177b7ce550eedfba9a8e62c45
BLAKE2b-256 d73ceb4a84b4fc92cab25bafddfe21d4ba566809510511cd6f42d33cfde86966

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 68b74b15a2c15d5e87658f381b7be0c07d27713ff5bdf61538a14cf486f926b3
MD5 c6fff76130abaeca841379d73f3f0361
BLAKE2b-256 8af8ac06d9490ef0f13a9bec4a000929d356872d6451404ec5fe87e7cbcac4f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c51393d827c6e70a7714c4199e5eb1fd5e54c127c0946e7fcd460db90e38544f
MD5 636b891255664b9326c22ba90bf86fd2
BLAKE2b-256 97ab6dc6126c79e8c2d424fd43a5d3c87b2da221a1b4ab5a9be93583b7249a52

See more details on using hashes here.

Provenance

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