A simple SDK for interacting with the OpenWeatherMap API
Project description
Weather SDK
A simple SDK for interacting with the OpenWeatherMap API.
Installation
You can install the package using pip:
pip install openweatherapi_sdk
Usage
- First, initialize the SDK with your OpenWeatherMap API key: from openweatherapi_sdk.sdk import WeatherSDK
sdk = WeatherSDK(api_key="YOUR_API_KEY_HERE")
- Get Weather by City Name You can retrieve weather data for a city by its name:
data = sdk.get_weather_by_city_name("London") print(data)
- Get Weather by Coordinates You can retrieve weather data for a location using its latitude and longitude coordinates:
data = sdk.get_weather_by_coordinates(lat=51.51, lon=-0.13) print(data)
- Get Weather Timestamp You can retrieve weather data timestamp for a location using its latitude and longitude coordinates and time:
data = sdk.get_weather_by_coordinates(lat=51.51, lon=-0.13, dt=1643803200 ) print(data)
- Get daily Aggregation You can retrieve daily aggregation for a location using its latitude and longitude coordinates, date and timezone:
data = sdk.get_weather_by_coordinates(lat=51.51, lon=-0.13,&date=2020-03-04) print(data)
- Make sure to replace
"YOUR_API_KEY_HERE"with your actual OpenWeatherMap API key in the usage examples.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openweatherapi_sdk-0.2.tar.gz.
File metadata
- Download URL: openweatherapi_sdk-0.2.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f7f1f5a666dea24e674e6bce18a31c103b6f2280d468be7e705fe88d92a60a0
|
|
| MD5 |
f14dfa0ff2c484d75fd578304cf39c2f
|
|
| BLAKE2b-256 |
c601796483a8f1d305414eb629f49a87280d3857eb3d589a0d7e9f44fbde62a4
|
File details
Details for the file openweatherapi_sdk-0.2-py3-none-any.whl.
File metadata
- Download URL: openweatherapi_sdk-0.2-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4031628c74eb75437642d28575b6f74150d4c3923c4275ab33f0cc7bee1ac476
|
|
| MD5 |
2b627548933c493361b54c6063dd4120
|
|
| BLAKE2b-256 |
c415bdb6e8f9e48d5cb74dd30990710c556dc9154496d21fb900e659c53572cf
|