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

Uploaded CPython 3.13Windows x86-64

rustwx-0.4.7-cp313-cp313-manylinux_2_39_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.4.7-cp313-cp313-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.4.7-cp312-cp312-win_amd64.whl (5.7 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.4.7-cp312-cp312-manylinux_2_39_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.4.7-cp312-cp312-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.4.7-cp311-cp311-win_amd64.whl (5.7 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.4.7-cp311-cp311-manylinux_2_39_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.4.7-cp311-cp311-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.4.7-cp310-cp310-win_amd64.whl (5.7 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.4.7-cp310-cp310-manylinux_2_39_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.4.7-cp310-cp310-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rustwx-0.4.7.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.4.7.tar.gz
Algorithm Hash digest
SHA256 91aceb3c016345612bc34ff2e28f69620f002837953abddd1cd6a82c2df03056
MD5 732a79f1a9971e1fd8662c3a590b998a
BLAKE2b-256 8f26001e7237dd103f6eddb6e3b3e714e3655d6abdfbd0fa490fbd84d9792ac1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.7-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7bd8fdc8b47a2f7273e2cc613d0ab5f3071866d13a298179c137d24c5867f07a
MD5 e2c89e989be4d079e127a65bc49b6996
BLAKE2b-256 c1839f392804e7e5367e629745b9ad0f64a272414eee977219532f455a7a7874

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fff48e9eae4ebe0803118ef56f68b153f9f9f092aad1288885be89e6f444836c
MD5 3d0d05386055f2742ce79a97811e1698
BLAKE2b-256 b620bde4b1de1df2e1f39be76521852d3c6d10ac870f43a2cc1023595798b258

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 198e455b776b059fb76189f7925f86e23aeffa8843a6fb22c6672e3fe8f204f0
MD5 464111cd5599685cd2f46ba184de9f6a
BLAKE2b-256 e2211e601baf9d1c6fd2aadd09eb68aeb6b4d4eb087e1374ce2f5e64bf7535a6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 63e9246d210560d630b3fabce33e073ef1f6e72749b8e166de63dea1ce5d6154
MD5 9904f1979d4467b5b539fb168ba726ca
BLAKE2b-256 c53cd417ea6aa3c9a56706cf176e4e8a7b17b1edcbcc89f733aa10da9743e9de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 82970b4cd7df9aca4c778c40a1aa4dede6f634c38de064756db4f3ce16ee8035
MD5 cd8f12ec75250a234f6196207c0e8b7a
BLAKE2b-256 bee6f87a43c90b7a969346be1dd090497b72f8cf698b95d017936880c15ef7c1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2393594f9f80a77315abb25493121a9eb51d029b5fc2e77e6f6fa589199ecef
MD5 62b7cb4c3218178e81a385e71cb0c0c0
BLAKE2b-256 c0cb3b01fcecc39ce24454461a543ae41ce840d60199a6f7f69d80e6555d1770

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2aef1238ec735a7a43f79a2eb3086162819dd15f1d182fbb8d4268cd4c7b3faa
MD5 2222eff6d48a1090291255666bff9aa8
BLAKE2b-256 ef67827df0e8d076dd9f8e5d1ac28ff420cb4e382193a3ccf23723d36dd50519

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 396a0ee83381c93ed008e2b33cc14e065e27090916f93817cba3a0f1a90586fb
MD5 a18061732a4903868a4fb7a4fd2efb7c
BLAKE2b-256 04921205b2016429ac555baaa1852389b197f3264311fb4d53cc90d9d68f4468

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9ae63b82f56be486e764c88ca7c6d1bb0afeff41914d6f74e6a56c44dda8d58
MD5 9bdb763d40d636cbe87357e38e217881
BLAKE2b-256 c9087e6dab7c3fa2800b12d8abaeafc9cd40201820b84cd06ac19dbe95efe644

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 5.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.4.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5bc069aba9975f88e3bb4a23b4eaeeae5ad14860c422bce646e0eee20465e50e
MD5 1267d04b793f315f97784b19c8736494
BLAKE2b-256 f7f7f2db5b2d928d842b80481f19e68117029d7f8a51f77718bf4765786fc06c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0238c0e1c48fe2d94818bf0d31789d02af242c71e2c96c869fa52d17c101125c
MD5 9b1e4f381acc81f9c9bd80952aae11a1
BLAKE2b-256 d1b10109950c218630a2800835b82f41c7341a68ba1a41f7fd6cfe30cd1055ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9aea35fc97a1ed96918314ab53d4f9405117e3d6e2004ceaa43c29c49d3a3cbf
MD5 39ea4ca945bbe7bed8632bc35d2a53fb
BLAKE2b-256 19fd2f623ea2ce95d44c89b91441a49aacd2d4350f46276e09d00702ba8aee79

See more details on using hashes here.

Provenance

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