Skip to main content

Client library to the AnavNet website, which provides the current warnings from the Portuguese maritime ports

Project description


Client library to the AnavNet website, which provides the current warnings from the Portuguese maritime ports.

  • Includes all the available port names and identifiers.
  • Counts the total messages per port.
  • Extracts all the information from the messages.
  • Includes a console script to consume the library.



$ pip install anavnet



>>> from anavnet import AnavNet
>>> anavnet = AnavNet()
>>> anavnet.set_port(16)
>>> anavnet.get_total_messages()
>>> 12
>>> anavnet.get_message(1)
{'num_aviso': '288/18', 'dt_promulgacao': '23-Ago-2018', 'dt_inicio': '24-Ago-2018', 'dt_fim': '05-Set-2018', 'ent_promulgacao': 'Capitania do Porto de Lisboa - CAPIMARLISBOA', 'local': 'Rio Tejo - Cais Militar do Portinho da Costa.', 'assunto': 'Área interdita à navegação', 'descricao': 'No período de 24AGO a 05SET, está interdita a navegação a menos de 50 metros do Cais Militar do Portinho da Costa.', 'dt_cancelamento': 'Data de cancelamento: 05-Set-2018'}

Console script:

$ anavclient --help

usage: anavclient [-h]
                  (--list | --total TOTAL | --text TEXT TEXT | --json JSON JSON)

optional arguments:
  -h, --help        show this help message and exit
  --list            Lists available ports
  --total TOTAL     Gets the total of messages. Argument: PORT_ID
  --text TEXT TEXT  Get message as formatted text. Arguments: PORT_ID, MESSAGE_INDEX
  --json JSON JSON  Get message as JSON. Arguments: PORT_ID, MESSAGE_INDEX


$ python -m unittest discover -s tests



Download files

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

Files for anavnet, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size anavnet-0.0.4.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View
Filename, size anavnet-0.0.4-py3-none-any.whl (5.5 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page