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, and render_maps_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

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.

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())

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
  • 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.2.tar.gz (1.6 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.2-cp313-cp313-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.13Windows x86-64

rustwx-0.4.2-cp313-cp313-manylinux_2_39_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

rustwx-0.4.2-cp313-cp313-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustwx-0.4.2-cp312-cp312-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.12Windows x86-64

rustwx-0.4.2-cp312-cp312-manylinux_2_39_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

rustwx-0.4.2-cp312-cp312-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustwx-0.4.2-cp311-cp311-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.11Windows x86-64

rustwx-0.4.2-cp311-cp311-manylinux_2_39_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

rustwx-0.4.2-cp311-cp311-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustwx-0.4.2-cp310-cp310-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.10Windows x86-64

rustwx-0.4.2-cp310-cp310-manylinux_2_39_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

rustwx-0.4.2-cp310-cp310-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rustwx-0.4.2.tar.gz
  • Upload date:
  • Size: 1.6 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.2.tar.gz
Algorithm Hash digest
SHA256 13c5e82132bdabc8cf4b486ad7401f34d08a566b1d0814ab91d6f43d195dc2d4
MD5 68e6ef8775fa502acf1542f2c81876ff
BLAKE2b-256 ec352819eda06bdf02232a8516a5d5db38218418a13d74d0a3d9ab807ccd8d3b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.6 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 824e9202c229a927702bb9807ecc644ca72b797e8f5f53d069f93a967b9af985
MD5 5dde36075a5836d26a269efc62697a60
BLAKE2b-256 8efd11680c7a8adb828bb5f8a0ebb18b986fb6cc8df813b56d5b2cb71f1b5996

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 aa568323a4b41079c037510f17255e7f0119a364d0b3bc256ef5d6be26362daf
MD5 3268a0538ee9e672403a8d663a9b8d4b
BLAKE2b-256 d4e5183333c0480b5b58d59298f612549c7999fb86d8df4cdf0ff7448d7b6136

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08f448e4bb5a2bcec241b953d856e8dfef5920b7174beafbc09e04f822072607
MD5 d71eff77bc370b14419f20f9604fdeaa
BLAKE2b-256 9335e11c75d7a540a6c0fbd8631888e256c30e739e7a0585aec6f93012052796

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.6 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 59b71e31bc0fd2983d5d2588bb206b82fbf9758f7d570a3a0d1dba9b8f119bf2
MD5 2a549da7cfb644a5f2718019a02e3177
BLAKE2b-256 69f804adde0e940b476794dea2f2b089e366283bc820206399400fc62fdccf46

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c616db2761666e54bc097fb98386d2cb6dab647be6c2b2b0404754c8e0424817
MD5 523017843af9801108bc32fb1944c9da
BLAKE2b-256 7900ee75ba97941e8e559950042f5d89e83af13771453b2bd28e9bb7069e07d8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f1c1281540c14fb982d13be9aad6032e8f70cf7e57a44997d7685438a324883e
MD5 775a5e6fdfa84128804046b02e132562
BLAKE2b-256 c12ebe225f5f99c3359846d1f7c5c78d56bf3d993149c927d21fa1e5b54d8f02

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.6 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b34eeaff27cf1c14385724c55eae2063d9b982a8adb25bdf36c5c855dfdc6f90
MD5 9bd2637ad1d2517e83abe575a663210f
BLAKE2b-256 4b7efe6aefea1b8fee17de040041aefa730c23f1e1a96ea2d3b4ca0e4fad7372

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c7a532087a7e02f411b62790df31e0e4249e0d5d2fbf87bb9302d14557194679
MD5 076b90ca8e954561791658ae86a8028d
BLAKE2b-256 76c3827a04920aa20b9b6ae72f1ede738ec18a74a0b6aa7427ff1b0e9b8035f6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1b137bb2a11d923fd56b750f914da20d8e267e0b1b02f36fe0af233c6734484
MD5 7efd86f78e7c9443dbe8912ae9b780a8
BLAKE2b-256 7843f30a6dd5cc14e402107c7ee65a72a73392c156841dbb9ef6bad80a9d7e47

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.6 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ed7e3a4565c8416ca4bd75b0cc85a8bdc489ebaa9792c5e79125827a514a6dcc
MD5 c38f48d2f36743455c0013dc0aa34837
BLAKE2b-256 f9f60381434cb47be2751576dfdf296452f5702783e388b1e135a10ab8159124

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bcdaf1bf4d5de3517183ac6bfada83848f30ab1721108154e405815fd75d79a6
MD5 9c08859a1cd94f40c2981ec591d97e4c
BLAKE2b-256 7472989ede3060d9f26009bb66174e3d0fda1ee712d0e0aa0e1ce2bd93225f96

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c666c108a8492f3f497f7b360bb9cfde56376258ccf5004dca54b1f3f8c34b3c
MD5 ae1bc6d7cb6b04ed117875160457a6b6
BLAKE2b-256 be54fe8e9a2a0abac23533afad29cfd1ee1d134a08cdf74b575195d2aefe687f

See more details on using hashes here.

Provenance

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