Skip to main content

Easy access to Jua's weather & power services

Project description

Jua Python SDK

Access industry-leading weather forecasts with ease

The Jua Python SDK provides a simple and powerful interface to Jua's state-of-the-art weather forecasting capabilities. Easily integrate accurate weather data into your applications, research, or analysis workflows.

Getting Started 🚀

Prerequisites

  • Python 3.11 or higher
  • Internet connection for API access

Installation

We strongly recommend using uv to manage dependencies:

uv init && uv add jua

Alternatively, you can install with pip:

pip install jua

Authentication

Generate an API key from the Jua dashboard and save it to ~/.jua/default/api-key.json.

Coming soon: Simply run jua auth to authenticate via your web browser.

Examples

Access the latest 20-day forecast for a point location

Retrieve temperature forecasts for Zurich and visualize the data:

import matplotlib.pyplot as plt
from jua import JuaClient
from jua.types.geo import LatLon
from jua.weather import Models, Variables

client = JuaClient()
model = client.weather.get_model(Models.EPT1_5)
zurich = LatLon(lat=47.3769, lon=8.5417)
# Get latest forecast
forecast = model.forecast.get_forecast(
    points=[zurich]
)
temp_data = forecast[Variables.AIR_TEMPERATURE_AT_HEIGHT_LEVEL_2M]
temp_data.to_celcius().to_absolute_time().plot()
plt.show()
Show output

Forecast Zurich 20d

Plot global forecast with 10-hour lead time

Generate a global wind speed visualization:

import matplotlib.pyplot as plt
from jua import JuaClient
from jua.weather import Models, Variables

client = JuaClient()
model = client.weather.get_model(Models.EPT1_5)

lead_time = 10 # hours
dataset = model.forecast.get_forecast(
    prediction_timedelta=lead_time,
    variables=[
        Variables.WIND_SPEED_AT_HEIGHT_LEVEL_10M,
    ],
)
dataset[Variables.WIND_SPEED_AT_HEIGHT_LEVEL_10M].plot()
plt.show()
Show output

Global Windspeed 10h

Access historical weather data

Retrieve and visualize temperature data for Europe from a specific date:

import matplotlib.pyplot as plt
from jua import JuaClient
from jua.weather import Models, Variables

client = JuaClient()
model = client.weather.get_model(Models.EPT1_5_EARLY)

init_time = "2024-02-01 06:00:00"
hindcast = model.hindcast.get_hindcast(
    variables=[Variables.AIR_TEMPERATURE_AT_HEIGHT_LEVEL_2M],
    init_time=init_time,
    prediction_timedelta=0,
    # Select Europe
    latitude=slice(71, 36),
    longitude=slice(-15, 50),
    method="nearest",
)

data = hindcast[Variables.AIR_TEMPERATURE_AT_HEIGHT_LEVEL_2M]
data.plot()
plt.show()
Show output

Europe Hindcast

Development Setup

Installing development dependencies

Install all required dependencies including extras:

uv sync --all-extras

Running examples

Execute example scripts:

uv run examples/weather/forecast.py

For example notebooks, ensure you select the correct Python interpreter in your notebook environment.

Documentation

For comprehensive documentation, visit docs.jua.ai.

Support

If you encounter any issues or have questions, please:

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

jua-0.4.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jua-0.4.0-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file jua-0.4.0.tar.gz.

File metadata

  • Download URL: jua-0.4.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.5

File hashes

Hashes for jua-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3cde9a69ab792a4a5f9d786e7e39a6dc70ba1c77e4167166e4b85a49bf1241af
MD5 82871ce1cb78563d2257a3dd93e36d8d
BLAKE2b-256 4d43f2d6ef63b5f93945bdfdb7213029b9061d6b2ac7f75376adc3b713dd380a

See more details on using hashes here.

File details

Details for the file jua-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: jua-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.5

File hashes

Hashes for jua-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9335d1c02a5fb89975a6a18fe7a0caaf6448576d45b259255432d5d9e300d1d4
MD5 00d4eefa3ff6d89f0ff1ccc729a4be24
BLAKE2b-256 47ce51b53b4d118b95889341623d99ab9c7545d454a43e53d408a90084b5a4e3

See more details on using hashes here.

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