Skip to main content

Python wrapper for decoding AIS messages via aggsoft.com (unofficial)

Project description

aggsoft-ais-decoder

Unofficial Python wrapper for decoding AIS (Automatic Identification System) messages via aggsoft.com.

Note: This library is not affiliated with, endorsed by, or connected to aggsoft.com. The service is provided by a third party.

Features

  • Decode AIS messages types 1-27
  • Support for single and multipart NMEA sentences
  • Async/await API with httpx
  • Configurable HTML fallback parser
  • Comprehensive error handling

Requirements

Internet connection required - This library relies on the aggsoft.com online service to decode AIS messages. The messages are sent to a third-party server for processing.

User Responsibility

  • Do not spam the service with excessive requests. Use appropriate delays between requests (see decode_batch delay parameter).
  • Verify compliance with aggsoft.com's terms of service before using this library.
  • You are responsible for ensuring your usage of the service is appropriate.

Installation

pip install aggsoft-ais-decoder

Or install from source:

pip install -e .

Quick Start

from aggsoft_ais_decoder import AISDecoderClient, decode

async def main():
    # Using client
    async with AISDecoderClient() as client:
        result = await client.decode("!AIVDM,1,1,,A,13u@ND0P01PJ=0lMH0nN20pl,0*7D")
        if result.success:
            print(f"Ship: {result.decoded.ship_name}")
            print(f"Position: {result.decoded.position}")

    # Or module-level function
    result = await decode("!AIVDM,1,1,,A,13u@ND0P01PJ=0lMH0nN20pl,0*7D")

Configuration

from aggsoft_ais_decoder import AISDecoderClient

# Enable HTML fallback if JSON parsing fails (default: False)
client = AISDecoderClient(enable_html_fallback=True)

# Customize timeout (default: 30 seconds)
client = AISDecoderClient(timeout=60.0)

API Reference

AISDecoderClient

client = AISDecoderClient(
    enable_html_fallback=False,  # Use HTML parser if JSON fails
    timeout=30.0                  # Request timeout in seconds
)

Methods:

  • decode(message: str | list[str]) - Decode single or multipart message
  • decode_batch(messages: list[str], delay=0.5) - Decode multiple messages

Returns: AISDecodeResponse with:

  • success: bool
  • decoded: AISShipData | None
  • error: str | None

Module Functions

from aggsoft_ais_decoder import decode, decode_batch

# Single message
result = await decode("!AIVDM,1,1,,A,13u@ND0P01PJ=0lMH0nN20pl,0*7D")

# Multipart message (list)
result = await decode(["!AIVDM,2,1,,A,13u@ND0P01Pj00000000000000", "!AIVDM,2,2,,A,0000000000000000000000000"])

# Batch
results = await decode_batch(["!AIVDM,1,1,,A,13u@ND0P01PJ=0lMH0nN20pl,0*7D"])

Dependencies

  • httpx >= 0.27.0
  • pydantic >= 2.0.0
  • beautifulsoup4 >= 4.12.0

Development

# Install dev dependencies
pip install -r requirements-dev.txt

# Run tests
pytest tests/

Legal

Copyright (c) 2026 KikiManjaro

This library is provided under the MIT License.

aggsoft.com is a third-party service. All rights reserved by their respective owners.

Project details


Download files

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

Source Distribution

aggsoft_ais_decoder-1.0.0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aggsoft_ais_decoder-1.0.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file aggsoft_ais_decoder-1.0.0.tar.gz.

File metadata

  • Download URL: aggsoft_ais_decoder-1.0.0.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for aggsoft_ais_decoder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 55351c093fc13b26f7cfd3ce9727b5ac462a09ceb0f2ad2ca08006dce570087d
MD5 ca97727532ed97567bbbe88a19a2c0ec
BLAKE2b-256 83f5319ebe660e06ba3a0f8012e4e16629f1c7d575bc8d2c89d2182708c362ce

See more details on using hashes here.

File details

Details for the file aggsoft_ais_decoder-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aggsoft_ais_decoder-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 080023eefcf83b3c9bc98011a14b319e9512887cea1a03d170904272f76d6545
MD5 0173931d38d8b4b92e15be54f468881c
BLAKE2b-256 90fc3aab7ddd73b6d0938d4c597977f0de56fefca3b6ec6c297e7e8848f8eb71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page