Skip to main content

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

openweatherapi_sdk-0.1.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.

openweatherapi_sdk-0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file openweatherapi_sdk-0.1.tar.gz.

File metadata

  • Download URL: openweatherapi_sdk-0.1.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

Hashes for openweatherapi_sdk-0.1.tar.gz
Algorithm Hash digest
SHA256 b98846858787d5a8929e9df40d2edc3a4788f8af8730aa2529e68797442e543a
MD5 850a6eafaf5c8d9b7b6dcd2eac5f66ec
BLAKE2b-256 89460d8e63c0a00d3192cce287719d59f7abf1352123b30586024d47f5414c14

See more details on using hashes here.

File details

Details for the file openweatherapi_sdk-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openweatherapi_sdk-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5530e67eae0d0c6d97d143eb00e9c34bfeb622eecdce088ad080a8b2962760ce
MD5 944d39644f787065f30e57b0757d618d
BLAKE2b-256 18fea06ae188c0d475a6e94e32b3acf1b0dc5c9e991c325b960222b0e32ad4c7

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