Skip to main content

easyOpenWeather module

This module is used to get or print the weather deatils using open weather API easily

install module using pip command

pip install easyOpenWeather

external dependencies required -

  1. requests
pip install requests
  1. tabulate
pip install tabulate

To import in project -

from easyOpenWeather import module

Then make a object instance of WeatherDataClass

obj = module.WeatherDataClass()

Now you need to at least set the city name and api key first

obj.setCityName("london")
obj.setApiKey("fe82651e607e4******ba45e39aa7e17")

To know how to get your own api key from open weather click here

Now you need to pass a list containing attributes for which you need weather data

List Attributes -

  1. temp -> for temperature in kelvin
  2. tempInC -> for temperature in celcius
  3. tempInF -> for temperature in f
  4. tempMin -> for min temp - unit is decided from above
  5. tempMax -> for max temp - unit is decided from above
  6. pressure -> for pressure
  7. humidity -> for humidity
  8. wind speed -> for wind speed
  9. wind direction -> for wind direction
  10. description -> for description - like clear sky etc
Note - use only one at a time from temp , tempInC , tempInF
All output data is in SI units

To set list Use -

listPass = ["tempInC" , "tempMin" , "tempMax" , "pressure" , "humidity" , "windSpeed" , "windDirection" , "clouds" , "description"]
obj.setList(listPass)

To get data in dictionary format -

obj.getInfo()

The function will return a dictionary.

Sample dictionary that you will get for listPass = ["tempInC" , "tempMin" , "tempMax" , "pressure" , "humidity" , "windSpeed" , "windDirection" , "clouds" , "description"] :

{'tempInC': 11.01, 'tempMin': 10.71, 'tempMax': 11.82, 'pressure': 998, 'humidity': 53, 'windSpeed': 8.7, 'windDirection': 260, 'clouds': 9, 'description': 'clear sky'}

This module also include a inbuilt function to directly print the data in a tabular format

obj.printData()

Other methods -

  1. obj.setStringKey(stringKey) - To set custom api url. Default url - https://api.openweathermap.org/data/2.5/weather?q=

    Some getters -

  2. obj.getStringKey()

  3. obj.getApiKey()

  4. obj.getCityName()

Sample program -

from easyOpenWeather import module

obj = module.WeatherDataClass()

obj.setCityName("london")
obj.setApiKey("fe82651e607e46db61dba45e39aa7e17")

listPass = ["tempInC" , "tempMin" , "tempMax" , "pressure" , "humidity" , "windSpeed" , "windDirection" , "clouds" , "description"]

obj.setList(listPass)
obj.printData()

Contibute -

Post any issues on github

Check out code on github

Metadata

Release files for easyOpenWeather 0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easyOpenWeather 0.22
File Size Uploaded Provenance Actions
easyOpenWeather-0.22.tar.gz 4.8 kB Without provenance Details for easyOpenWeather-0.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for easyOpenWeather 0.22
File Interpreter ABI Platform Actions
easyOpenWeather-0.22-py3-none-any.whl Python 3 none any Details for easyOpenWeather-0.22-py3-none-any.whl

Total release size: 22.3 kB

Release files / easyOpenWeather-0.22.tar.gz

Download URL easyOpenWeather-0.22.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1ee84646223ed9e3634e99ea86a3280dbc14b5ba2982e533cf2c17f76489aab2
BLAKE2b-256 checksum
How to use checksums
d525848603acebfc18d59071000983e6453b5a274e294ab5c51eef8940c178bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / easyOpenWeather-0.22-py3-none-any.whl

Download URL easyOpenWeather-0.22-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6da1f49d3eed213b7d43ae9a4a1acbdc387fe924c7dc0c1088469dc1001ddaf9
BLAKE2b-256 checksum
How to use checksums
b8024d5a46fc17fcb8e244e3569ef0d566ff9e94d091b87480711aaeafc42654
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Security for easyOpenWeather 0.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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