Skip to main content

AnavNet

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.

Requirements

Installation

$ pip install anavnet

Usage

Library

>>> 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

Tests

$ python -m unittest discover -s tests

License

BSD-3-Clause

Release files for anavnet 0.0.4

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

Source distribution (sdist)

Source distribution for anavnet 0.0.4
File Size Uploaded
anavnet-0.0.4.tar.gz 4.3 kB Details

Built distribution (wheel)

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

Total release size: 9.8 kB

Release files / anavnet-0.0.4.tar.gz

Download URL anavnet-0.0.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
32e7de8ad5e3e2131667330023af24bac1e2e686b16af826b2e2d8746e204a03
BLAKE2b-256 checksum
How to use checksums
6758926b349da5fe1d88365d9ec39aaaed9010c4c313ed06baa010e5fe2ebb86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

Release files / anavnet-0.0.4-py3-none-any.whl

Download URL anavnet-0.0.4-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44a71df487d4d95046af86fcb3ca64a460e53cfa8124758fb360d0b302acef0a
BLAKE2b-256 checksum
How to use checksums
827718633515ea46094cd2dcfa0de8f1b4e663a055e72b90cf42e9618dfaaf28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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