A lightweight python library to extract weather data
Project description
pyweatherlite Documentation
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyweatherlite-0.1.0.tar.gz
.
File metadata
- Download URL: pyweatherlite-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 410e5e45a593c60bd542a2c7262ec35f0dbc3b269b7f381981d3b3dbd5dc0d2e |
|
MD5 | 42c83a48bb4cdee8c68fff0225907f40 |
|
BLAKE2b-256 | 58504997b76f7715f4d764bc3ed580d59addcb57599e5e393ca47070e0f384cf |
File details
Details for the file pyweatherlite-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pyweatherlite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78c7834138ed4f3a1186de46274453fe0879db82dbd951fdbe4685e093e660c4 |
|
MD5 | 9b7a4f6e030dee3f8756c994d3f6ac82 |
|
BLAKE2b-256 | 973c097b2a07c203b2b028569d4cf2ff7de42ff4543d371efa72ceadbc8cdef4 |