Weather

Weather

The Weather class is your gateway to Jua's weather forecasting capabilities, providing access to all available weather models and their data services.

Overview

The Weather class serves as the central hub for accessing Jua's weather models. Each model provides access to:

  • Weather forecast data (future predictions)

  • Weather hindcast data (historical records)

This class is not meant to be instantiated directly. Instead, you should always access it through the weather property of a JuaClient instance.

A default request_credit_limit exists, which blocks users from making requests which will cost more than a given number of credits. If you ever hit that limit but want to make the query anyway (and override the limit), you can just set the request_credit_limit in the JuaClient to the desired value.

Accessing Weather Models

from jua import JuaClient
from jua.weather import Models

# Initialize the client
client = JuaClient()

# Initialize the client with a higher request_credit_limit
client = JuaClient(request_credit_limit=100)

# Access the Weather instance
weather = client.weather

# Get a specific model
ept2_model = weather.get_model(Models.EPT2)

Available Models

Jua provides several weather models with different characteristics (resolution, forecast range, etc.). You can access any model using the Models enum:

# Get different models
ept2 = client.weather.get_model(Models.EPT2)
ept15 = client.weather.get_model(Models.EPT1_5)

Note: Some models are only available in premium subscriptions.

Dictionary-Style Access

For convenience, you can also use dictionary-style syntax to access models:

# These are equivalent
ept2 = client.weather.get_model(Models.EPT2)
ept2 = client.weather[Models.EPT2]

Working with Models

Once you have a model instance, you can access its capabilities:

# Get a model
model = client.weather.get_model(Models.EPT2)

# Get a forecast (returns a JuaDataset)
forecast_data = model.get_forecasts(...)

Best Practices

  1. Always use the Models enum for type-safe access to weather models

  2. Access Weather through the client - never create Weather instances directly

Last updated