[![PyPI version](https://badge.fury.io/py/pyipma.svg)](https://badge.fury.io/py/pyipma)
# pyipma
Python library to retrieve information from [Instituto Português do Mar e Atmosfera](http://www.ipma.pt)
## Requirements
- aiohttp
- geopy
## Example
```python
import asyncio
import aiohttp
from pyipma.api import IPMA_API
from pyipma.location import Location
async def main():
async with aiohttp.ClientSession() as session:
api = IPMA_API(session)
location = await Location.get(api, 40.6517, -8.6573, sea_stations=True)
print("Forecast for {}".format(location.name))
print("Nearest station is {}".format(location.station))
print("Nearest sea station is {}".format(location.sea_station_name))
obs = await location.observation(api)
print("Current weather is {}".format(obs))
forecasts = await location.forecast(api)
print("Forecast for tomorrow {}".format(forecasts[0]))
sea_forecast = await location.sea_forecast(api)
print("Sea forecast for today {}".format(sea_forecast))
asyncio.get_event_loop().run_until_complete(main())
```
## Changelog
* 3.0.6 - Bug Fixes
* 3.0.3 - Adds RCM (Fire Risk)
* 3.0.2 - Changes to fully support Home Assistant integration
* 3.0.0 - Backend fully rewritten, but keeping backward compatibility at interface level
* 2.1.5 - Better logging and code formated with black
* 2.1.0 - Sea Forecast
* 2.0.5 - Look for previous observations when no temperature/humidity available
* 2.0.4 - Ignore Observation stations with temperature/humidity -99
* 2.0.3 - Searches next closest station when offline
* 2.0.2 - Adds Station Lat/Lon
* 2.0.1 - fixes
* 2.0.0 - Major refactor
* 1.2.1 - Fix pip
* 1.2.0 - Wind direction corrected
* 1.1.6 - Interpret -99 and unavailable
* 1.1.5 - Cache values
* 1.1.4 - New API
* ...
## Credits
Values are obtained from [IPMA](http://api.ipma.pt)
## Contributors
@abmantis
@joaocps
## Copyright
(C) 2018,2019,2020 Diogo Gomes <diogogomes@gmail.com>
Raw data
{
"_id": null,
"home_page": "https://github.com/dgomes/pyipma",
"name": "pyipma",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Diogo Gomes",
"author_email": "diogogomes@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f7/4a/99428840b5ea084db27143ba2b1cbf9199603c4b5dabd282659d149b2aad/pyipma-3.0.7.tar.gz",
"platform": "any",
"description": "[![PyPI version](https://badge.fury.io/py/pyipma.svg)](https://badge.fury.io/py/pyipma)\n\n# pyipma\nPython library to retrieve information from [Instituto Portugu\u00eas do Mar e Atmosfera](http://www.ipma.pt)\n\n## Requirements\n- aiohttp\n- geopy\n\n## Example\n\n```python\nimport asyncio\nimport aiohttp\n\nfrom pyipma.api import IPMA_API\nfrom pyipma.location import Location\n\nasync def main():\n async with aiohttp.ClientSession() as session:\n api = IPMA_API(session)\n\n location = await Location.get(api, 40.6517, -8.6573, sea_stations=True)\n print(\"Forecast for {}\".format(location.name))\n print(\"Nearest station is {}\".format(location.station))\n print(\"Nearest sea station is {}\".format(location.sea_station_name))\n\n obs = await location.observation(api)\n print(\"Current weather is {}\".format(obs))\n\n forecasts = await location.forecast(api)\n print(\"Forecast for tomorrow {}\".format(forecasts[0]))\n \n sea_forecast = await location.sea_forecast(api)\n print(\"Sea forecast for today {}\".format(sea_forecast))\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n\n## Changelog\n\n* 3.0.6 - Bug Fixes\n* 3.0.3 - Adds RCM (Fire Risk)\n* 3.0.2 - Changes to fully support Home Assistant integration\n* 3.0.0 - Backend fully rewritten, but keeping backward compatibility at interface level\n* 2.1.5 - Better logging and code formated with black\n* 2.1.0 - Sea Forecast\n* 2.0.5 - Look for previous observations when no temperature/humidity available\n* 2.0.4 - Ignore Observation stations with temperature/humidity -99\n* 2.0.3 - Searches next closest station when offline\n* 2.0.2 - Adds Station Lat/Lon\n* 2.0.1 - fixes\n* 2.0.0 - Major refactor\n* 1.2.1 - Fix pip\n* 1.2.0 - Wind direction corrected \n* 1.1.6 - Interpret -99 and unavailable\n* 1.1.5 - Cache values\n* 1.1.4 - New API\n* ...\n\n## Credits\nValues are obtained from [IPMA](http://api.ipma.pt)\n\n\n## Contributors\n@abmantis\n@joaocps\n\n## Copyright\n\n(C) 2018,2019,2020 Diogo Gomes <diogogomes@gmail.com> \n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Python library to retrieve information from Instituto Portugu\u00eas do Mar e Atmosfera.",
"version": "3.0.7",
"project_urls": {
"Homepage": "https://github.com/dgomes/pyipma"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f74a99428840b5ea084db27143ba2b1cbf9199603c4b5dabd282659d149b2aad",
"md5": "65f2070f67e995b0b17b8f2f79d8cde2",
"sha256": "5873aed71f887aa091d05f50dbc3555c0ec1d7dad9c1da5afea5a73c3c5aa4c3"
},
"downloads": -1,
"filename": "pyipma-3.0.7.tar.gz",
"has_sig": false,
"md5_digest": "65f2070f67e995b0b17b8f2f79d8cde2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13875,
"upload_time": "2023-09-13T20:46:19",
"upload_time_iso_8601": "2023-09-13T20:46:19.003168Z",
"url": "https://files.pythonhosted.org/packages/f7/4a/99428840b5ea084db27143ba2b1cbf9199603c4b5dabd282659d149b2aad/pyipma-3.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-13 20:46:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dgomes",
"github_project": "pyipma",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "mock",
"specs": []
},
{
"name": "pytest-asyncio",
"specs": []
},
{
"name": "geopy",
"specs": []
},
{
"name": "aiohttp",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "pytest_asyncio",
"specs": []
},
{
"name": "aioresponses",
"specs": []
},
{
"name": "freezegun",
"specs": []
}
],
"lcname": "pyipma"
}