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.

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

Uploaded CPython 3.13Windows x86-64

rustwx-0.4.0-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.0-cp313-cp313-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

rustwx-0.4.0-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.0-cp312-cp312-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

rustwx-0.4.0-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.0-cp311-cp311-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

rustwx-0.4.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: rustwx-0.4.0.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.0.tar.gz
Algorithm Hash digest
SHA256 1322978bcd50c2e6667113537eddff2e83bb5973758c784531b6ff6bc67179df
MD5 e2a0f7d632186804c8cc31352814effc
BLAKE2b-256 9664347df756c144dd5b0cfb83b508614a6f0e3c70bbc0bfa65061e2f14a7b14

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.0-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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9ed0b399ef743f461044d8cb072676fb334e3277067f4323ee68a8510149b921
MD5 2d1aeb42b1341911826b2e221287e67e
BLAKE2b-256 3b714ccda5bfd5c5aa6b9a2c53c31514cf866ca94a832213f313b6d83822b44d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c2760d4eed142acf295b3db1b6a1b5c39c885e5807b755d94d7098a7670a7ea4
MD5 bcafcddce2854242b3f705cdb058bf14
BLAKE2b-256 01b1613e4b1403464a2b9bd1ebaa14948fa82994e48be03909a27c7318bcff11

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf08f9dafe4fc4761645e6360cad33188cb911ec436ab166ccbdd7c8e5a337d3
MD5 0b0c86b78136ca2b44b346e106a13f69
BLAKE2b-256 850cb458d14085c608902ef0d6c0911b944ce654b3bb2474b7b7b9aabc69e67a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e6d82875641a31cfa41abd672d99e62f63b46947d7dee764e10ad4d4cf5288fc
MD5 94bb4cb7d89bf8cae35ed2b57551308d
BLAKE2b-256 71db4f15627f41a20ead2790d3312a81ed00a5c7f50c65c247d850c131980934

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 22d08544428c3be9cc36997f303eef38654ab8ab518c8eef75b0b6067456b7db
MD5 d7dd756a984e79526eda24422744bd1b
BLAKE2b-256 c8879977f7fa1f82775ca6c7af64074340bf58cca8f5efca3ca12195f402c459

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8cf717128a3fd42cd2bce39f424b15ab7a3ae7c060f7e040be3f37ca631b9915
MD5 f8050a7256985449e71c766b2e9d0d7b
BLAKE2b-256 9a2d284fb39184d809f6ca0f51c2e804abef42a7e7e5e67767885a013142bb08

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f0662616bb7e326257148eb18c68fd832685eb5b4329a92d05c03c8831c132dc
MD5 af15d8569f6c1263fe7b1f92d2f3bcbb
BLAKE2b-256 9a2da3de6c43acd2cc889511c08d0019fbc5077c6c84b535c66def303c3b702d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ecbbb2f50ee817f671f6784718617bf5304901385d2955fdce9dbe9806aa3cd8
MD5 41ef1bb24c6e1dabf4f682d8a68b6cfe
BLAKE2b-256 e357809c50be764d067a9e3b351a05a2ccafc829f69fcb551cf978b5919c517e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a499fa404df66bb0ae4757d19895301d82258b2f70b21d128b07dd5957097ce2
MD5 8435964402384ea6f6b4b2ac8d7a2efd
BLAKE2b-256 21b8ae82bbf15a177fccc26d8c7e87482c9c624d5f920eae9e96b63534f48fd9

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rustwx-0.4.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3a63dc7318a1540d1a748b33482dfad2775e62e217f225dccecdde86e961e6a3
MD5 ff81e4e55aa2e6d4140bd120fe60bce5
BLAKE2b-256 1a35e8e538361261c7a69109bbf4ba969ee67638f4e0b959c1564d680ac27637

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 417262dbc3ce6735f4087124a690eea47d4e4759ec9c4a920025f7d92fc39b45
MD5 c0d7c5ddfa1ce7594cae7c5cde33176f
BLAKE2b-256 c5b869cd55b5befeeaddf12e47d5a6662f4ae79a06ac573630c483a38a0c47d1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rustwx-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6520b470c7492378dd78fbcc40b49dd4280b7f8f7cb2ec747aed9dc0c9680238
MD5 8381fd6e051aa6ad2953f816ab2ae7d7
BLAKE2b-256 c1bb1acc9d57e059e18aaa26b237eec6bca4fe684b44942109407bdbfc67fa55

See more details on using hashes here.

Provenance

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