Coder Social home page Coder Social logo

pyipma's Introduction

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, 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.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 [email protected]

pyipma's People

Contributors

abmantis avatar dgomes avatar joaocps avatar k0der avatar tokenize47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyipma's Issues

Tag the source

It would be very helpful if you could tag releases as well. This would enable distributions who want to run your tests to fetch the package from GitHub instead of Pypi, where the tests are excluded.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.