### Run All Examples Source: https://github.com/gribstream/python-client/blob/main/README.md Execute all provided example scripts after installing the client from a source checkout. Some examples require an API key. ```bash python examples/timeseries_rows.py python examples/runs_forecast_aging.py python examples/as_of_backtest.py python examples/json_response.py python examples/ensemble_members.py python examples/shared_parameter_timeseries.py python examples/multimodel_shared_compare.py python examples/grid_filter.py python examples/ndjson_stream.py python examples/selector_lookup_to_query.py python examples/payload_builder.py python examples/catalog_discovery.py python skewtlogp.py ``` -------------------------------- ### Quickstart: Query Timeseries Data Source: https://github.com/gribstream/python-client/blob/main/README.md A basic example demonstrating how to query timeseries forecast data for a specific location and time range. It shows how to define coordinates and variables with aliases. ```python from gribstream import GribStreamClient with GribStreamClient() as client: rows = client.timeseries( dataset="gfs", from_time="2026-04-04T00:00:00Z", until_time="2026-04-04T06:00:00Z", coordinates=[client.coordinate(29.7604, -95.3698, "Houston")], variables=[client.variable("TMP", "2 m above ground", alias="temp_k")], min_lead_time="0h", max_lead_time="24h", ) for row in rows[:3]: print(row) ``` -------------------------------- ### Install Optional Plotting Dependencies Source: https://github.com/gribstream/python-client/blob/main/README.md Install optional dependencies for plotting, required for examples like the Skew-T visualization. Use this command after checking out from source. ```bash pip install -e '.[examples]' ``` -------------------------------- ### Run Skew-T Example with Output Source: https://github.com/gribstream/python-client/blob/main/README.md Execute the Skew-T example script and specify an output file path for the generated PNG image. This example does not require authentication. ```bash python skewtlogp.py --output out/skewt-houston.png ``` -------------------------------- ### Install GribStream Python Client (PyPI) Source: https://github.com/gribstream/python-client/blob/main/README.md Install the GribStream Python client from PyPI using pip. This is the standard installation method for published versions. ```bash pip install gribstream ``` -------------------------------- ### Install GribStream Python Client (Source Checkout) Source: https://github.com/gribstream/python-client/blob/main/README.md Install the GribStream Python client from a source checkout. This involves setting up a virtual environment and installing in editable mode. ```bash python -m venv .venv source .venv/bin/activate pip install -e . ``` -------------------------------- ### Query with Exact Selectors Source: https://github.com/gribstream/python-client/blob/main/README.md Example of querying forecast data using an exact selector obtained from `get_dataset_parameter`. This ensures precise data retrieval. ```python selector = parameter["variations"][0]["selector"] selector["alias"] = "temp_k" rows = client.timeseries( dataset="ifsoper", from_time="2026-04-04T00:00:00Z", until_time="2026-04-04T12:00:00Z", coordinates=[client.coordinate(51.5072, -0.1276, "London")], variables=[selector], ) ``` -------------------------------- ### Request Streaming NDJSON Response Format Source: https://github.com/gribstream/python-client/blob/main/README.md Example of requesting forecast data in a streaming NDJSON format by setting `accept=NDJSON` and `stream=True`. This is efficient for large datasets. ```python from gribstream import NDJSON for row in client.timeseries(..., accept=NDJSON, stream=True): print(row) ``` -------------------------------- ### Query Runs Data Source: https://github.com/gribstream/python-client/blob/main/README.md Example of querying all model runs within a specified time window using the `runs` method. This is useful for analyzing forecast aging or run-to-run variations. ```python rows = client.runs( dataset="gfs", forecasted_from="2026-04-04T00:00:00Z", forecasted_until="2026-04-04T06:00:00Z", coordinates=[client.coordinate(29.7604, -95.3698, "Houston")], variables=[client.variable("TMP", "2 m above ground", alias="temp_k")], min_lead_time="0h", max_lead_time="18h", ) ``` -------------------------------- ### Request JSON Response Format Source: https://github.com/gribstream/python-client/blob/main/README.md Example of requesting forecast data in JSON format by setting the `accept` parameter to `JSON`. This is an alternative to the default CSV parsing. ```python from gribstream import JSON rows = client.timeseries(..., accept=JSON) ``` -------------------------------- ### Query Timeseries Data (Runs vs Timeseries) Source: https://github.com/gribstream/python-client/blob/main/README.md Demonstrates querying the freshest available run for each valid time using the `timeseries` method. This is suitable for general forecast lookups. ```python rows = client.timeseries( dataset="gfs", from_time="2026-04-04T00:00:00Z", until_time="2026-04-04T06:00:00Z", coordinates=[client.coordinate(29.7604, -95.3698, "Houston")], variables=[client.variable("TMP", "2 m above ground", alias="temp_k")], ) ``` -------------------------------- ### Set GribStream API Key Source: https://github.com/gribstream/python-client/blob/main/README.md Set your GribStream API key as an environment variable. This token is required for authentication when querying forecast data. ```bash export GRIBSTREAM_API_KEY='YOUR_TOKEN_HERE' ``` -------------------------------- ### Resolve and Use Shared Parameters Source: https://github.com/gribstream/python-client/blob/main/README.md Demonstrates how to resolve a shared parameter like 'wind_speed_10m' for a specific dataset and then use it in a `timeseries` query. This simplifies multi-model queries. ```python with GribStreamClient() as client: wind_request = client.resolve_shared_parameter( "wind_speed_10m", dataset="ifsoper", alias="wind_mps", ) rows = client.timeseries( dataset="ifsoper", from_time="2026-04-04T00:00:00Z", until_time="2026-04-04T12:00:00Z", coordinates=[client.coordinate(51.5072, -0.1276, "London")], variables=wind_request["variables"], expressions=wind_request.get("expressions"), ) ``` -------------------------------- ### Discover Dataset Parameters Source: https://github.com/gribstream/python-client/blob/main/README.md Use the `get_dataset_parameter` helper to find exact selectors for parameters within a dataset. This is useful for ensuring correct parameter names and levels. ```python from gribstream import GribStreamClient with GribStreamClient() as client: parameter = client.get_dataset_parameter("ifsoper", "2t") for variation in parameter["variations"]: print(variation["selector"]) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.