Skip to main content

A weather lookup plugin for Sopel IRC bots

Project description

sopel-weather

A weather lookup plugin for Sopel IRC bots.

Note: This package was previously published as sopel-modules.weather. Please update your dependencies to use sopel-weather instead.

Installation

pip install sopel-weather

Quick Start

Configure the plugin using:

sopel configure --plugins

Or manually edit ~/.sopel/default.cfg:

[weather]
geocoords_provider = locationiq_us
geocoords_api_key = YOUR_LOCATIONIQ_API_KEY
weather_provider = openmeteo
weather_api_key = dummy

Weather Providers

Provider API Key Required Free Tier UV Index Features
Open-Meteo No (use "dummy") Unlimited No Best for basic weather, no signup needed
Tomorrow.io Yes 500 calls/day Yes Modern API, good accuracy
Pirate Weather Yes 20,000 calls/month Yes Dark Sky replacement
OpenWeatherMap Yes 1,000 calls/day Yes Popular, well-documented

Open-Meteo (Recommended for simplicity)

No API key required. Use any string (e.g., "dummy") for the weather_api_key.

[weather]
weather_provider = openmeteo
weather_api_key = dummy

Tomorrow.io

Sign up at https://www.tomorrow.io/ for a free API key.

[weather]
weather_provider = tomorrow
weather_api_key = YOUR_TOMORROW_API_KEY
  • Free tier: 500 API calls/day
  • Includes UV index
  • Modern REST API

Pirate Weather

Sign up at https://pirateweather.net/ for a free API key.

[weather]
weather_provider = pirateweather
weather_api_key = YOUR_PIRATEWEATHER_API_KEY
  • Free tier: 20,000 API calls/month
  • Drop-in Dark Sky API replacement
  • Includes UV index

OpenWeatherMap

Sign up at https://openweathermap.org/ for a free API key.

[weather]
weather_provider = openweathermap
weather_api_key = YOUR_OPENWEATHERMAP_API_KEY
  • Free tier: 1,000 API calls/day
  • Includes UV index

Geocoding Provider

A geocoding provider is required to convert location names (like "Seattle" or "90210") to coordinates.

LocationIQ (Required)

Sign up at https://locationiq.com/ for a free API key.

[weather]
geocoords_provider = locationiq_us
geocoords_api_key = YOUR_LOCATIONIQ_API_KEY

Options:

  • locationiq_us - US-based servers (recommended for North America)
  • locationiq_eu - EU-based servers (recommended for Europe)

Free tier: 5,000 requests/day

Configuration Options

Option Description Default
geocoords_provider Geocoding provider (locationiq_us, locationiq_eu) locationiq_us
geocoords_api_key API key for geocoding provider Required
weather_provider Weather provider (openmeteo, tomorrow, pirateweather, openweathermap) Required
weather_api_key API key for weather provider Required
sunrise_sunset Show sunrise/sunset times False
nick_lookup Allow looking up weather by IRC nickname True

Example Configuration

[weather]
geocoords_provider = locationiq_us
geocoords_api_key = pk.abc123...
weather_provider = tomorrow
weather_api_key = abc123xyz...
sunrise_sunset = True
nick_lookup = True

Commands

Current Weather

.weather              # Uses your saved location
.weather seattle
.weather Seattle, US
.weather 90210

Example output:

Seattle, Washington, US: 12°C (54°F), Partly Cloudy, Humidity: 75%, UV Index: 2, Gentle breeze: 19km/h (12mph) (↑)

Forecast

.forecast             # Uses your saved location
.forecast seattle
.forecast London, UK

Example output:

Seattle, WA, US :: Monday - Partly Cloudy - 12°C (54°F) / 5°C (41°F) :: Tuesday - Rain - 14°C (57°F) / 6°C (43°F) ...

Set Your Location

.setlocation seattle
.setlocation 98101
.setlocation London, UK

Troubleshooting

"Weather API key missing"

Set weather_api_key in your configuration. For Open-Meteo, use any string like "dummy".

"GeoCoords API key missing"

Sign up at https://locationiq.com/ and add your API key to geocoords_api_key.

"Could not geocode location"

  • Check your LocationIQ API key is valid
  • Try a more specific location (e.g., "Seattle, WA" instead of "Seattle")
  • Check LocationIQ rate limits (5,000/day on free tier)

"Error: Invalid API key"

Verify your weather provider API key is correct and active.

UV Index not showing

UV Index is only available with Tomorrow.io, Pirate Weather, and OpenWeatherMap providers.

Requirements

  • Sopel 8.0+
  • Python 3.8+

License

Eiffel Forum License 2

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

sopel_weather-2.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

sopel_weather-2.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file sopel_weather-2.1.0.tar.gz.

File metadata

  • Download URL: sopel_weather-2.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sopel_weather-2.1.0.tar.gz
Algorithm Hash digest
SHA256 9fc43c9c1a81f969d6e0ef9282ad305c541d8bda5a526db93877fc0b42776250
MD5 133c4d2e1c222c24caf6d65d9d887152
BLAKE2b-256 50132fea5892e736d30ddaf062511642a8f57956fada441f98f8b4fef7da51f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for sopel_weather-2.1.0.tar.gz:

Publisher: python-publish.yml on sopel-irc/sopel-weather

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sopel_weather-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: sopel_weather-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sopel_weather-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd91e2dfade3f921c81513ceb248bbc54e8b695ec0d34fddc22fb9ad86824e8
MD5 eec03340c770f8d7492af72f9c2929d4
BLAKE2b-256 dc1cbcf45d0e7254a4dc17ac721ec135644a5360252b3c008579d90dd88e0b61

See more details on using hashes here.

Provenance

The following attestation bundles were made for sopel_weather-2.1.0-py3-none-any.whl:

Publisher: python-publish.yml on sopel-irc/sopel-weather

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