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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

rustwx-0.5.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: rustwx-0.5.3.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.3.tar.gz
Algorithm Hash digest
SHA256 3aa569320eb6c595bf2aee15a7380a97f2eb91b17c4a79da5c949ef2db628a78
MD5 65d749459e59cd71e5f19d505cd94c31
BLAKE2b-256 766992e76f9e4a713441df383307bd532d5a75e87affe2b2c2afe9eb30f43f98

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 420d7867b6286fa4a4d94e62272a946dc8b62dd170d91d921b93dba14f1902b8
MD5 c919d7f967af1c25e57a7568d5546e77
BLAKE2b-256 1fda6a5bd439ea30b74e207261acca46ed0e82acc6f348ced44ffd5c15ae294a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c1deb53688e0744afbdb4506ba229f3a5b674a0bd2eac907dd524359c92ab8b5
MD5 356423016164cfc8b9506ae06ce6b6ad
BLAKE2b-256 6c12dc92125a76902699bc859ea74aa7e1d448ef6685c344d5e82c10a35f080b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4e4241f1c179ceb9a0bfa771af598e91c2b9de5ef7c43f46c4219aaa434bcdd
MD5 9be360ec72a28a7ed926463b94976715
BLAKE2b-256 82a8defa8258e817ac535b38a7d383ece8291c9ba24c9a7ee57271f020f59a79

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 da305da1efcd1e2a7a046bd9bb927adc3b51ecf279294ab140393a4a7d491524
MD5 083f9e487163e14695c04260d7ab8c1e
BLAKE2b-256 770f2379ea755dd446f1f10b9eb6dec6d2a9cca019c1019245ca493650fcde77

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ea95e3fc903d68bafaffec5d26f2a23eb8b1efe55dccdb7ac48c59cc2435f563
MD5 9081dbef0026fd8fba0036ee65befe87
BLAKE2b-256 1d781bc84b25f798ee6bb6ada6e966df0a4cc93de6e704b4d13dcdeadc082d6f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6279f511f3ab9460c39a91932d31884b24833f3c67fb5a30cdfa07fa952fb4cf
MD5 50ed4ba188e34cb5db60b59c2c0ce896
BLAKE2b-256 9b33dcc5d1fedbf88f3f17918f6844c411a359e4040ce5dc3d306b6d2c59306f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f3d16c06840e9ffd096b0b7d2bb83d6bd759da0fcaf1a66483ecd47f998d8c4c
MD5 57403e3c91f69cf69633cefeb5b8da07
BLAKE2b-256 2a437ba6f2599e6b4daeaf42318c79fb877f2b9839800ee86eb03bf3cefb2b94

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 eebf73c657419eea41e53660e156ee5a62c8844b43dd578f90008f3142a0bce6
MD5 8c247e1d507e48e372c2ddfae3fa724e
BLAKE2b-256 6e883d4ca81219cdb0653b077ea227add9dc8afa2c642346d7072a55c9967f14

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a2ceb634588fea93d0e6f7bd136024bc070fce994518426c67cb4e7c8c77ce9
MD5 68f5e64502fff84c8a46bb6fc3f19630
BLAKE2b-256 a119a6a35cf4f788ebf37f47ffaea78dcdfc79a4fc2a7541332ef1cb0142f07f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.5.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9147b4cae0ebc97184f985d22d99f5fc6cf77ef5bb9c52e0dc8acee2b95828b5
MD5 a105eb49c3b5e0659377b8e8a857cacd
BLAKE2b-256 249a993968dcd87273e7ea7d8934e8462dc0948a39d2b9e7c1ef8f09c637a06f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3ecc2744dfdbe3d7f1738da95f5e96f38cc94bc17de701c6f78b0deed21b1465
MD5 ef1b32755d5eabcba0f73d7e1c525a30
BLAKE2b-256 a70d744c3927368548b2920d8f6ab58974ae9cf8868073cc1a5c4ecb05335fd5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.5.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f285facce12aab42b7b60003330baf9856ce15ef8c0d8669c363d956a842c879
MD5 d542b605efa86b105da7e0981a12dd9e
BLAKE2b-256 c8c6fa59d3ce581c48fd5221b949a8cdeb76fccac64ee821eefd16bde548fdb9

See more details on using hashes here.

Provenance

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