Skip to main content

pyweatherlite Documentation

License GitHub stars GitHub forks GitHub issues

A lightweight Python library to extract weather data from OpenWeatherMap.

Table of Contents

Introduction

pyweatherlite is a simple and easy-to-use Python library that allows you to retrieve weather data from OpenWeatherMap. It provides convenient methods to access various weather attributes such as temperature, humidity, pressure, wind speed, and more.

Key features:

  • Lightweight and easy to integrate into your projects.
  • Flexible configuration to use your API key and location for weather data retrieval.
  • Support for fetching weather data based on latitude and longitude.

Installation

You can install pyweatherlite using pip:

Usage

Getting Started

To use pyweatherlite, you'll need to sign up for an API key from OpenWeatherMap (https://openweathermap.org/api). Once you have the API key, you can use the library to retrieve weather data for various attributes.

Here's a simple example to get the current temperature:

from pyweatherlite.index import Scaffold, LegacyScaffold

# Set your OpenWeatherMap API key and City
api_key = "YOUR_API_KEY"
city = "YOUR_CITY_NAME"

# Create a WeatherFetcher instance
inst = Scaffold()

# Get the current temperature for a specific city
temperature = inst.get_temp(pkey=apikey, city="London")

print(f"The current temperature in London is {temperature}°C.")

# Assuming you have your city coordinates then use LegacyScaffold
inst = LegacyScaffold()

api_key = "YOUR_API_KEY"
longitude = "YOUR_LONGITUDE_COORD"
latitude = "YOUR_LATITUDE_COORD"

# Get the current temperature for a specific coordinates
temperature = inst.get_temp(pkey=apikey, lon=longitude, lat=latitude)

print(f"The current temperature is {temperature}°C.")

Contributing

We welcome contributions from the community! If you have any bug fixes, improvements, or new features to add, feel free to open a pull request on our GitHub repository. Please ensure that your code follows the project's coding guidelines.

License

This project is licensed under the MIT License.

Credits

Author: Michael Appiah Dankwah (https://github.com/Terre8055)

Release files for pyweatherlite 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyweatherlite 0.1.0
File Size Uploaded
pyweatherlite-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyweatherlite 0.1.0
File Interpreter ABI Platform
pyweatherlite-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / pyweatherlite-0.1.0.tar.gz

Download URL pyweatherlite-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
410e5e45a593c60bd542a2c7262ec35f0dbc3b269b7f381981d3b3dbd5dc0d2e
BLAKE2b-256 checksum
How to use checksums
58504997b76f7715f4d764bc3ed580d59addcb57599e5e393ca47070e0f384cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / pyweatherlite-0.1.0-py3-none-any.whl

Download URL pyweatherlite-0.1.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78c7834138ed4f3a1186de46274453fe0879db82dbd951fdbe4685e093e660c4
BLAKE2b-256 checksum
How to use checksums
973c097b2a07c203b2b028569d4cf2ff7de42ff4543d371efa72ceadbc8cdef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page