Skip to main content

WeatherKit ☀️

What is It?

WeatherKit is a python pacakge that provides a simple interface to get weather data without any API key or any other credentials. It is a simple and easy to use package that provides the current weather data of any location in the world. It can get weather details from address, city, country, or latitude and longitude of the location.

Currently it Provies the following weather details for current time and forecast for 7 days:

  • Temperature ☀️
  • Humidity 💧
  • Wind Speed 💨
  • Weather Code ⛅️
  • Precipitation ☔️

Where to get it?

The easy way to get WeatherKit is from pip:

pip install weatherkit

Dependencies

geopy - For getting latitude and longitude of the location if the location is given in address or city format.

Installing from source

Download the source code by cloning the repository or by clicking here

git clone https://github.com/suvanbanerjee/weatherkit.git
cd weatherkit

Build the package using the following command:

python setup.py sdist bdist_wheel

Install the package using the following command:

pip install dist/*.whl

Usage

Current Weather

Sample usage providing city name

import weatherkit
NYC = weatherkit.current_weather('New York')
print(NYC.temperature())
# Output: 20.0
print(NYC.temperature(units='imperial'))
# Output: 68.0
print(NYC.humidity())
# Output: 50
print(NYC.weather_code())
# Output: 3
print(NYC.precipitation())
# Output: 0.0

Sample usage providing latitude and longitude

import weatherkit
NYC = weatherkit.current_weather(40.7128, -74.0060)
print(NYC.temperature())
# Output: 20.0
print(NYC.temperature(units='imperial'))
# Output: 68.0
print(NYC.humidity())
# Output: 50
print(NYC.weather_code())
# Output: 3
print(NYC.precipitation())
# Output: 0.0

Daily Forecast

Sample usage providing city name

import weatherkit
NYC = weatherkit.daily_forecast('New York')
print(NYC.max_temperature())
# Output: 20.0
print(NYC.max_temperature(units='imperial'))
# Output: 68.0
print(NYC.min_temperature())
# Output: 10.0
print(NYC.max_temperature(day_offset=3))
# Output: 20.0
print(NYC.max_temperature(day_offset=3, units='imperial'))
# Output: 68.0
print(NYC.prediction_sum())
# Output: 0.0
print(NYC.prediction_sum(day_offset=3))
# Output: 3.2
print(NYC.prediction_sum(units='imperial'))
# Output: 0.0 (in Inches)
print(NYC.weather_code())
# Output: 3
print(NYC.weather_code(day_offset=3))
# Output: 3

Note

  • Similar to current weather, daily forecast can also be used by providing latitude and longitude.

  • day_offset is the number of days from today for which the forecast is required. day_offset=0 (which is default) will give the forecast for today, day_offset=1 will give the forecast for tomorrow and so on.

Contributing

Contributions are welcome, and they are greatly appreciated! just fork the repository, make changes and create a pull request.

License

WeatherKit is distributed under the MIT License. See the LICENSE file for more information.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weatherkit-1.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weatherkit-1.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file weatherkit-1.1.0.tar.gz.

File metadata

  • Download URL: weatherkit-1.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for weatherkit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 59477ee38cae2a00b524af385365405b0b5d6c380ed6ad698ea7159cad1799d6
MD5 fd893633611c11126221cb398d68fb29
BLAKE2b-256 903609f3c7d0082638b6ba9db14c86ca0483b701fd6ca1794940f54a2adf4e4c

See more details on using hashes here.

File details

Details for the file weatherkit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: weatherkit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for weatherkit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18b2f015d7e25c6f66f99fbdf531c4e0468cff77e2e0d39c3a52b068264401dc
MD5 eea44b7fa1f773be4a29ceebd0927e36
BLAKE2b-256 60d772d862bbdc2cceb53340c2f374aa27d4b257925dbe729f63c2903350f58f

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.1

2 files

This release

1.1.0 This release

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.1.0

2 files

0.0.1

2 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