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-0.2.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

weatherkit-0.2.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for weatherkit-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b9d742e676fa1b1d652c8f1a3e5a39a7269b6b9aafc534312599880e78534f17
MD5 c01176d0307994eb41c8689d40213692
BLAKE2b-256 f88e4282b31b57527beaee93988fa267f3f13191c92996ca5651cb4e058e3074

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for weatherkit-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 beaaa2033d8e61482f658389b7e724d75701e9227307cbf593990f29e0034ae9
MD5 5a422038b12d37e320886b8eff8116cf
BLAKE2b-256 a636d0e630a5c7eb4d3ccb00efbc2997025b7e3cd5d102c56074b008dfbd5222

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

This release

0.2.3 This release

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