csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
791 stars 175 forks source link

One Call: add exclude and possibly units parameters #322

Closed jwmelvin closed 4 years ago

jwmelvin commented 4 years ago

The One Call API allows for an 'exclude' parameter to streamline responses. It would be great if pyowm allowed this too.

Similarly, the API allows for a 'units' parameter. It might be more convenient for users to receive data in the desired format, but I don't know if that would interfere with pyowm's internal handling.

Thank you for such a wonderful library!

csparpa commented 4 years ago

nice features! would you like helping me with the implementation?

jwmelvin commented 4 years ago

It's not that I am unwilling to help, but I'm not there yet. I have the project forked and cloned to my linux machine. I haven't yet figured out how to get python to use that working version so I can blunder through the necessary changes...

csparpa commented 4 years ago

You're almost there! You could Install - say - python 3.8 with your Linux package manager

What's your Linux distro? eg Ubuntu and Debian derivatives you can use:

apt-get install python3.X

in Fedor you can use rpm

Once installed Python, you're set to go!

PS: if you're stuck with the package manager thing remember that you can alway install Python from sources - https://www.python.org/downloads/release/python-383/

jwmelvin commented 4 years ago

Oh, I have python 3.8 installed and working with the pyowm that pip installs. I just haven't sorted out how to get python to use the version in a local directory tree.

csparpa commented 4 years ago

Mmmm better to remove PyOWM at a global system level:

pip uninstall pyowm

Once removed, you're guaranteed the only PyOWM that can be can run on your machine is the one you've cloned from GitHub

Move inside your clone folder, open a Python prompt and import pyowm: you're running the local Python code, which now you are free to edit.

Just pls remember to work-commit-push on the develop branch!

jwmelvin commented 4 years ago

Thanks for the help. I have made the proposed changes, which seem to work in all use cases, and submitted a pull request to the develop branch.

csparpa commented 4 years ago

Thanks @jwmelvin this has been merged with https://github.com/csparpa/pyowm/pull/326