/aemet-marine-forecast-bot

Repository to get ©AEMET weather predictions and publish them on telegram channels. Why? To be able to access this information in areas of low or sporadic mobile coverage.

Primary LanguagePython

AEMET MARINE FORECAST BOT

Repository to get ©AEMET weather predictions and publish them on telegram channels (E.g. Balearic Islands Channel). Why? To be able to access this information in areas of low or sporadic mobile coverage.

INSTALL

pipenv install

TEST

pipenv run pytest .

RUN

You must create a file called .env in the root folder with this environment vars or set those vars when you call the script:

AEMET_API_KEY=54653MY.Aemet.455845API.key
TELEGRAM_TOKEN=6352785479:MyTelegram-TOken
MAR_FORECAST_COASTAL_CHAT_ID=-10054478265423
MAR_FORECAST_COASTAL_CODE=ILLES_BALEARS

AEMET_API_KEY

The API REST developed by AEMET needs an api key. You can request it here: https://opendata.aemet.es/centrodedescargas/altaUsuario

TELEGRAM_TOKEN

You will need a token for the telegram bot that writes the messages. Learn more about it here: https://core.telegram.org/bots/api#authorizing-your-bot

MAR_FORECAST_COASTAL_CHAT_ID

The telegram channel where the messages will be published and in which your bot must have admin write permissions, has an id similar to -10054478265423.

MAR_FORECAST_COASTAL_CODE

You can see the available coast_codes in the following configuration file: src/config.py

pipenv run python  src/main.py