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.2.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.2-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

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

Hashes for openweatherapi_sdk-0.2.tar.gz
Algorithm Hash digest
SHA256 3f7f1f5a666dea24e674e6bce18a31c103b6f2280d468be7e705fe88d92a60a0
MD5 f14dfa0ff2c484d75fd578304cf39c2f
BLAKE2b-256 c601796483a8f1d305414eb629f49a87280d3857eb3d589a0d7e9f44fbde62a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openweatherapi_sdk-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4031628c74eb75437642d28575b6f74150d4c3923c4275ab33f0cc7bee1ac476
MD5 2b627548933c493361b54c6063dd4120
BLAKE2b-256 c415bdb6e8f9e48d5cb74dd30990710c556dc9154496d21fb900e659c53572cf

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