Skip to main content

Python library to retrieve information from Instituto Português do Mar e Atmosfera.

Project description

PyPI version

pyipma

Python library to retrieve information from Instituto Português do Mar e Atmosfera

Requirements

  • aiohttp
  • geopy

Example

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)
        print("Forecast for {}".format(location.name))
        print("Nearest station is {}".format(location.station))

        obs = await location.observation(api)
        print("Current weather is {}".format(obs))

        forecasts = await location.forecast(api)
        print("Forecast for tomorrow {}".format(forecasts[0]))

asyncio.get_event_loop().run_until_complete(main())

Changelog

  • 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

Contributors

@abmantis

Copyright

(C) 2018 Diogo Gomes diogogomes@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyipma-2.0.1.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file pyipma-2.0.1.tar.gz.

File metadata

  • Download URL: pyipma-2.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4

File hashes

Hashes for pyipma-2.0.1.tar.gz
Algorithm Hash digest
SHA256 13b005b5e3a6e41fa80051decb6b2681219b008610d56123a3f9777b9a520a9b
MD5 5080a3b0ee0c4fe40657197444666954
BLAKE2b-256 a0a36d4b866432b2df7494e3bdb3d8a5273152efcec6446e444720f66d1cb759

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page