Skip to main content

PyPI version

pyipma

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

Requirements

  • aiohttp
  • geopy

Example

Coordinates are passed as latitude, longitude.

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.10 - Update aiohttp support and response handling
  • 3.0.9 - Adjust forecast window for 24 hours periods
  • 3.0.8 - Adds Weather Warnings
  • 3.0.7 - Adds UV Index (@tokenize74)
  • 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

Contributors

@abmantis @joaocps

Copyright

(C) 2018,2019,2020 Diogo Gomes diogogomes@gmail.com

Metadata

Release files for pyipma 3.0.10

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

Source distribution (sdist)

Source distribution for pyipma 3.0.10
File Size Uploaded
pyipma-3.0.10.tar.gz 20.8 kB Details

Built distribution (wheel)

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

Total release size: 38.4 kB

Release files / pyipma-3.0.10.tar.gz

Download URL pyipma-3.0.10.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b44b61e38cd070cc8e68846ea7414c2a56912d594cceac7975d3c4539421d65e
BLAKE2b-256 checksum
How to use checksums
5454827f597ea8ebc3555eabd48183c232027f138ccf0f4fa168488a35c22aee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pyipma-3.0.10-py3-none-any.whl

Download URL pyipma-3.0.10-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ea4e3f08b86ab3aae3259fe4b25208bf2170ee129978a23ac22dae7668c97cf
BLAKE2b-256 checksum
How to use checksums
2504d6918c4eba0f352e7531bd06b8756c3ee011bf3d601c784929d944a11266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

3.0.10 This release

2 release files

3.0.9

1 release file

3.0.8

1 release file

3.0.7

1 release file

3.0.6

1 release file

3.0.5

1 release file

3.0.4

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.1.5

1 release file

2.1.0

1 release file

2.0.5

1 release file

2.0.4

1 release file

2.0.3

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.6

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

2 release files

1.0.1

1 release file

1.0.0

1 release file

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