Skip to main content

A simple Python package to fetch and process weather data from OpenWeatherMap API.

Project description

weatherbuddy

A simple Python package to fetch and process weather data from the OpenWeatherMap API.

Features

  • Get weather forecast for any city or coordinates
  • Returns time, temperature (Celsius), and weather description for the next 12 hours
  • Easy to use and extend

Installation

pip install weatherbuddy

Usage

from weatherbuddy import Weather
import pprint

api_key = "YOUR_API_KEY"
city = "London"
weather = Weather(api_key, city=city)
print(f"Weather forecast for {city} for the next 12 hours:")
pprint.pprint(weather.next_12_hours_simplified())

Example Output

Weather forecast for London for the next 12 hours:
[('2023-10-01 12:00:00', 15, 'light rain'),
 ('2023-10-01 15:00:00', 16, 'moderate rain'),
 ('2023-10-01 18:00:00', 14, 'clear sky'),
 ('2023-10-01 21:00:00', 13, 'light rain')]

Requirements

  • Python 3.7+
  • requests
  • python-dotenv

API Key

Get your free API key from OpenWeatherMap.

License

MIT

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

weatherbuddy-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

weatherbuddy-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file weatherbuddy-0.1.0.tar.gz.

File metadata

  • Download URL: weatherbuddy-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for weatherbuddy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ee00c0fa00771a9b603176742f91856160af688950e29e3915aa9d17a765c20
MD5 21a0daa0a799d9fefe9656c293b4b0bc
BLAKE2b-256 dcf2b001fafa0d4190f813af17ec880de3eec7782284b7738f301d2e36b4d4c2

See more details on using hashes here.

File details

Details for the file weatherbuddy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: weatherbuddy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for weatherbuddy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0643b7d4943307b4de90145c4c9fa7074b0bd338adc869e0b3689eb1e7449d16
MD5 9ee1444fc8bed1d37a76c1741d888479
BLAKE2b-256 4129e8f940eee4321d58de60a5ee5e741ecddc1847bb12aa4a63979c00d48a57

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