pyowm


Namepyowm JSON
Version 3.4.0 PyPI version JSON
download
home_pagehttps://github.com/csparpa/pyowm
SummaryA Python wrapper around OpenWeatherMap web APIs
upload_time2025-08-22 10:21:33
maintainerNone
docs_urlNone
authorClaudio Sparpaglione
requires_python>=3.8
licenseMIT
keywords openweathermap web api client weather forecast uv alerting owm pollution meteostation agro agriculture
VCS
bugtrack_url
requirements geojson PySocks requests requests
Travis-CI
coveralls test coverage
            [![logo](logos/180x180.png)](https://github.com/csparpa)

#  PyOWM  
**A Python wrapper around OpenWeatherMap web APIs**

[![PyPI version](https://badge.fury.io/py/pyowm.svg)](https://badge.fury.io/py/pyowm)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/pyowm.svg)](https://img.shields.io/pypi/dm/pyowm.svg)
<br>
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyowm.svg)](https://img.shields.io/pypi/pyversions/pyowm.svg)
<br>
[![Latest Release Documentation](https://readthedocs.org/projects/pyowm/badge/?version=latest)](https://pyowm.readthedocs.io/en/latest/)
[![Build Status](https://travis-ci.org/csparpa/pyowm.png?branch=develop)](https://travis-ci.org/csparpa/pyowm)
[![Coverage Status](https://coveralls.io/repos/github/csparpa/pyowm/badge.svg?branch=develop)](https://coveralls.io/github/csparpa/pyowm?branch=master)
<br>
<a href="https://www.buymeacoffee.com/LmAl1n9" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/black_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/csparpa%40gmail.com)

##  What is it?
PyOWM is a client Python wrapper library for OpenWeatherMap (OWM) web APIs. It allows quick and easy consumption of OWM data from Python applications via a simple object model and in a human-friendly fashion.

PyOWM runs on Python 3.8+

**Former Dark Sky API users**: you can can use PyOWM to get [OpenWeatherMap's OneCall API](https://openweathermap.org/api/one-call-api) data as an easy replacement to Dark Sky

### What kind of data can I get with PyOWM ?
With PyOWM you can integrate into your code any of the following OpenWeatherMap web APIs:

 - **Weather API v3.0** + **OneCall API**, providing current weather data, weather forecasts, weather history
 - **Agro API v1.0**, providing soil data and satellite imagery search and download
 - **Air Pollution API v3.0**, providing data about CO, O3, NO2 and SO2
 - **UV Index API v3.0**, providing data about Ultraviolet exposition
 - **Stations API v3.0**, allowing to create and manage meteostation and publish local weather measurements
 - **Weather Alerts API v3.0**, allowing to set triggers on weather conditions and areas and poll for spawned alerts
 - **Image tiles** for several map layers provided by OWM
 - **Geocoding API v1.0** allowing to perform direct/reverse geocoding 


## In case of trouble...
Please **read the [FAQ](https://pyowm.readthedocs.io/en/latest/v3/faq.html)** before filing a new issue on GitHub! There are many common issues, therefore a fix for your issue might come easier than you think

 ##  Get started

### API key

As OpenWeatherMap APIs need a valid API key to allow responses, *PyOWM won't work if you don't provide one*. This stands for both free and paid (pro) subscription plans.
You can signup for a free API key [on the OWM website](https://home.openweathermap.org/users/sign_up)
Please notice that the free API subscription plan is subject to requests throttling.

### Example

With a free OWM API Key:

```python
from pyowm import OWM
from pyowm.utils import config
from pyowm.utils import timestamps

# ---------- FREE API KEY examples ---------------------

owm = OWM('your free OWM API key')
mgr = owm.weather_manager()


# Search for current weather in London (Great Britain) and get details
observation = mgr.weather_at_place('London,GB')
w = observation.weather

w.detailed_status         # 'clouds'
w.wind()                  # {'speed': 4.6, 'deg': 330}
w.humidity                # 87
w.temperature('celsius')  # {'temp_max': 10.5, 'temp': 9.7, 'temp_min': 9.0}
w.rain                    # {}
w.heat_index              # None
w.clouds                  # 75

# Will it be clear tomorrow at this time in Milan (Italy) ?
forecast = mgr.forecast_at_place('Milan,IT', 'daily')
answer = forecast.will_be_clear_at(timestamps.tomorrow())

# ---------- PAID API KEY example ---------------------

config_dict = config.get_default_config_for_subscription_type('professional')
owm = OWM('your paid OWM API key', config_dict)

# What's the current humidity in Berlin (Germany) ?
one_call_object = mgr.one_call(lat=52.5244, lon=13.4105)
one_call_object.current.humidity
```


##  Installation
Install with `pip` for your ease:

```shell
$ pip install pyowm
```

There are alternatives: _setuptools_, _Windows installers_ and common Linux package managers such as _Yaourt (Arch Linux)_
_YaST/Zypper (OpenSuse)_ (please refer to the documentation for more detail)

Eager to fetch the very latest updates to PyOWM? Install the development trunk (which might be unstable). Eg on Linux:

```shell
$ git clone https://github.com/csparpa/pyowm.git
$ cd pyowm && git checkout develop
$ pip install -r requirements.txt && python setup.py install
```

## Documentation
The library software API documentation is available on [Read the Docs](https://pyowm.readthedocs.io/en/latest/).

The [Code recipes](https://pyowm.readthedocs.io/en/latest/v3/code-recipes.html) section comes in handy!


## Community & Contributing

Here are [some cool projects](https://github.com/csparpa/pyowm/wiki/Community-Projects-using-PyOWM) that use PyOWM

_Contributors (coding, testing, packaging, reporting issues) are welcome!_ See the [the official documentation website](https://pyowm.readthedocs.io/) for details or the [CONTRIBUTING.md](https://github.com/csparpa/pyowm/blob/master/CONTRIBUTING.md) file for a quick primer.


## License
[MIT license](https://github.com/csparpa/pyowm/blob/master/LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/csparpa/pyowm",
    "name": "pyowm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "openweathermap web api client weather forecast uv alerting owm pollution meteostation agro agriculture",
    "author": "Claudio Sparpaglione",
    "author_email": "csparpa@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b2/61/1927be67958fa0a19a16665fe319394f648c8f49f2a3c44bf98f4e67e1ca/pyowm-3.4.0.tar.gz",
    "platform": null,
    "description": "[![logo](logos/180x180.png)](https://github.com/csparpa)\n\n#  PyOWM  \n**A Python wrapper around OpenWeatherMap web APIs**\n\n[![PyPI version](https://badge.fury.io/py/pyowm.svg)](https://badge.fury.io/py/pyowm)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/pyowm.svg)](https://img.shields.io/pypi/dm/pyowm.svg)\n<br>\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyowm.svg)](https://img.shields.io/pypi/pyversions/pyowm.svg)\n<br>\n[![Latest Release Documentation](https://readthedocs.org/projects/pyowm/badge/?version=latest)](https://pyowm.readthedocs.io/en/latest/)\n[![Build Status](https://travis-ci.org/csparpa/pyowm.png?branch=develop)](https://travis-ci.org/csparpa/pyowm)\n[![Coverage Status](https://coveralls.io/repos/github/csparpa/pyowm/badge.svg?branch=develop)](https://coveralls.io/github/csparpa/pyowm?branch=master)\n<br>\n<a href=\"https://www.buymeacoffee.com/LmAl1n9\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/black_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" ></a>\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/csparpa%40gmail.com)\n\n##  What is it?\nPyOWM is a client Python wrapper library for OpenWeatherMap (OWM) web APIs. It allows quick and easy consumption of OWM data from Python applications via a simple object model and in a human-friendly fashion.\n\nPyOWM runs on Python 3.8+\n\n**Former Dark Sky API users**: you can can use PyOWM to get [OpenWeatherMap's OneCall API](https://openweathermap.org/api/one-call-api) data as an easy replacement to Dark Sky\n\n### What kind of data can I get with PyOWM ?\nWith PyOWM you can integrate into your code any of the following OpenWeatherMap web APIs:\n\n - **Weather API v3.0** + **OneCall API**, providing current weather data, weather forecasts, weather history\n - **Agro API v1.0**, providing soil data and satellite imagery search and download\n - **Air Pollution API v3.0**, providing data about CO, O3, NO2 and SO2\n - **UV Index API v3.0**, providing data about Ultraviolet exposition\n - **Stations API v3.0**, allowing to create and manage meteostation and publish local weather measurements\n - **Weather Alerts API v3.0**, allowing to set triggers on weather conditions and areas and poll for spawned alerts\n - **Image tiles** for several map layers provided by OWM\n - **Geocoding API v1.0** allowing to perform direct/reverse geocoding \n\n\n## In case of trouble...\nPlease **read the [FAQ](https://pyowm.readthedocs.io/en/latest/v3/faq.html)** before filing a new issue on GitHub! There are many common issues, therefore a fix for your issue might come easier than you think\n\n ##  Get started\n\n### API key\n\nAs OpenWeatherMap APIs need a valid API key to allow responses, *PyOWM won't work if you don't provide one*. This stands for both free and paid (pro) subscription plans.\nYou can signup for a free API key [on the OWM website](https://home.openweathermap.org/users/sign_up)\nPlease notice that the free API subscription plan is subject to requests throttling.\n\n### Example\n\nWith a free OWM API Key:\n\n```python\nfrom pyowm import OWM\nfrom pyowm.utils import config\nfrom pyowm.utils import timestamps\n\n# ---------- FREE API KEY examples ---------------------\n\nowm = OWM('your free OWM API key')\nmgr = owm.weather_manager()\n\n\n# Search for current weather in London (Great Britain) and get details\nobservation = mgr.weather_at_place('London,GB')\nw = observation.weather\n\nw.detailed_status         # 'clouds'\nw.wind()                  # {'speed': 4.6, 'deg': 330}\nw.humidity                # 87\nw.temperature('celsius')  # {'temp_max': 10.5, 'temp': 9.7, 'temp_min': 9.0}\nw.rain                    # {}\nw.heat_index              # None\nw.clouds                  # 75\n\n# Will it be clear tomorrow at this time in Milan (Italy) ?\nforecast = mgr.forecast_at_place('Milan,IT', 'daily')\nanswer = forecast.will_be_clear_at(timestamps.tomorrow())\n\n# ---------- PAID API KEY example ---------------------\n\nconfig_dict = config.get_default_config_for_subscription_type('professional')\nowm = OWM('your paid OWM API key', config_dict)\n\n# What's the current humidity in Berlin (Germany) ?\none_call_object = mgr.one_call(lat=52.5244, lon=13.4105)\none_call_object.current.humidity\n```\n\n\n##  Installation\nInstall with `pip` for your ease:\n\n```shell\n$ pip install pyowm\n```\n\nThere are alternatives: _setuptools_, _Windows installers_ and common Linux package managers such as _Yaourt (Arch Linux)_\n_YaST/Zypper (OpenSuse)_ (please refer to the documentation for more detail)\n\nEager to fetch the very latest updates to PyOWM? Install the development trunk (which might be unstable). Eg on Linux:\n\n```shell\n$ git clone https://github.com/csparpa/pyowm.git\n$ cd pyowm && git checkout develop\n$ pip install -r requirements.txt && python setup.py install\n```\n\n## Documentation\nThe library software API documentation is available on [Read the Docs](https://pyowm.readthedocs.io/en/latest/).\n\nThe [Code recipes](https://pyowm.readthedocs.io/en/latest/v3/code-recipes.html) section comes in handy!\n\n\n## Community & Contributing\n\nHere are [some cool projects](https://github.com/csparpa/pyowm/wiki/Community-Projects-using-PyOWM) that use PyOWM\n\n_Contributors (coding, testing, packaging, reporting issues) are welcome!_ See the [the official documentation website](https://pyowm.readthedocs.io/) for details or the [CONTRIBUTING.md](https://github.com/csparpa/pyowm/blob/master/CONTRIBUTING.md) file for a quick primer.\n\n\n## License\n[MIT license](https://github.com/csparpa/pyowm/blob/master/LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python wrapper around OpenWeatherMap web APIs",
    "version": "3.4.0",
    "project_urls": {
        "Homepage": "https://github.com/csparpa/pyowm"
    },
    "split_keywords": [
        "openweathermap",
        "web",
        "api",
        "client",
        "weather",
        "forecast",
        "uv",
        "alerting",
        "owm",
        "pollution",
        "meteostation",
        "agro",
        "agriculture"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "add3ce12b164dbf12501cc6f7ecc784809056d677017c31371aba5f1cbaeee88",
                "md5": "d48a67175a6dbfe48cbaf959b82c7732",
                "sha256": "d0fdeeaba3ce7b1cb6ab52aa076fd63bd836f210e9b43ad49aa936b835effbd5"
            },
            "downloads": -1,
            "filename": "pyowm-3.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d48a67175a6dbfe48cbaf959b82c7732",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4546644,
            "upload_time": "2025-08-22T10:21:31",
            "upload_time_iso_8601": "2025-08-22T10:21:31.528601Z",
            "url": "https://files.pythonhosted.org/packages/ad/d3/ce12b164dbf12501cc6f7ecc784809056d677017c31371aba5f1cbaeee88/pyowm-3.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b2611927be67958fa0a19a16665fe319394f648c8f49f2a3c44bf98f4e67e1ca",
                "md5": "6079d8535ec5f1440daec13931035bf9",
                "sha256": "e366b12d6ff4668f5f8e3ad85ad345b9d7048ea76479add2222385e9df85515e"
            },
            "downloads": -1,
            "filename": "pyowm-3.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6079d8535ec5f1440daec13931035bf9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4516389,
            "upload_time": "2025-08-22T10:21:33",
            "upload_time_iso_8601": "2025-08-22T10:21:33.738725Z",
            "url": "https://files.pythonhosted.org/packages/b2/61/1927be67958fa0a19a16665fe319394f648c8f49f2a3c44bf98f4e67e1ca/pyowm-3.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-22 10:21:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "csparpa",
    "github_project": "pyowm",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "geojson",
            "specs": [
                [
                    "<",
                    "3"
                ],
                [
                    ">=",
                    "2.3.0"
                ]
            ]
        },
        {
            "name": "PySocks",
            "specs": [
                [
                    ">=",
                    "1.7.1"
                ],
                [
                    "<",
                    "2"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "<",
                    "3"
                ],
                [
                    ">=",
                    "2.20.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": []
        }
    ],
    "tox": true,
    "lcname": "pyowm"
}
        
Elapsed time: 0.63961s