pyais
AIS message decoding
What it is and what it does
pyais is a pure-Python library for decoding and encoding AIS messages—the digital protocol ships use to broadcast identification, position, course, and speed via VHF radio. AIS data arrives as NMEA 0183 sentences and is transmitted in six-bit ASCII encoding; pyais handles the parsing and reconstruction of that binary payload into structured vessel information. The library supports single messages, multipart messages, file streams, and live TCP/UDP socket feeds, making it suitable for both offline analysis and real-time maritime monitoring.
The package is production-ready, having been tested against live feeds from Spire, the Norwegian Coastal Administration, and other real-world sources. It includes utilities for reading files, iterating over message streams, and a TCP server for concurrent client connections. Encoding is also supported, allowing you to construct AIS sentences from dictionaries of vessel data. The single runtime dependency is attrs, and installation is straightforward.
Use it for:
- Decode live AIS feeds from maritime authorities or satellite operators to track vessel positions and movements in real time.
- Parse historical AIS message logs from files to analyze shipping patterns, port traffic, or vessel behavior.
- Build a TCP server that aggregates AIS data from multiple client connections for centralized maritime monitoring.
- Encode vessel information into AIS sentences for simulation, testing, or custom maritime data systems.
- Extract structured vessel metadata (MMSI, callsign, position, speed, course) from raw NMEA radio broadcasts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Decodes and encodes AIS (Automatic Identification System) messages from maritime VHF radio broadcasts, supporting single messages, files, and TCP/UDP socket streams in pure Python.
Yes. pyais is actively maintained, has no known vulnerabilities, installs with minimal friction, and is licensed permissively. Install it if you need to work with AIS maritime data—whether decoding live feeds, analyzing historical logs, or building maritime monitoring tools.
Install
pyais on PyPI
pip
pip install pyaisuv
uv add pyaispoetry
poetry add pyaisInstalling pyais
Before you install
Low friction install with a single runtime dependency (attrs). Actively maintained with a release 5 days old and 253 repository stars. Officially supports Python 3.9 and later.
License in practice
MIT License permits unrestricted use, modification, and distribution with only attribution and liability disclaimer required—suitable for commercial and proprietary projects.
Quickstart
from pyais import decode
decoded = decode(b"!AIVDM,1,1,,B,15NG6V0P01G?cFhE`R2IU?wn28R>,0*05")
print(decoded)
Requires Python 3.9 or later.
Verify before relying
- Whether the package's performance characteristics (e.g., throughput for high-volume streams) meet specific maritime monitoring workloads.
- Compatibility with non-standard or proprietary AIS message variants beyond the AIVDM/AIVDO formats documented.
Package facts
| License | MIT License Copyright (c) 2019 M0r13n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — attrs |
| Maintenance | actively maintained — 5 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 147,411/month — #11,066 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyais-3.2.1-py3-none-any.whl
Keywords: AIS, ship, decoding, NMEA, maritime
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pynmea2Parses and generates NMEA 0183 sentences from…
permissive · top 15,000 on PyPI
pynmeagpsParses and generates NMEA 0183 GPS/GNSS…
permissive · top 15,000 on PyPI
rf-protocolsDecodes and encodes radio frequency signals for…
permissive · top 15,000 on PyPI
x690Encodes and decodes data using the X.690 BER…
permissive · top 15,000 on PyPI
pyubx2Parses and generates UBX protocol messages from…
permissive · top 15,000 on PyPI
py-multibaseEncodes and decodes data using the Multibase…
permissive · top 15,000 on PyPI
pylzsspylzss decodes and encodes data compressed with…
copyleft · top 15,000 on PyPI
pyheifReads HEIF/HEIC image files and exposes their…
permissive · top 15,000 on PyPI
pyrtcmParses RTCM3 differential GNSS protocol…
permissive · top 15,000 on PyPI
pyiso8583Serializes and deserializes ISO8583 financial…
permissive · top 15,000 on PyPI