{"id":24294,"library":"pyais","title":"PyAIS","description":"A Python library for decoding and encoding AIS (Automatic Identification System) messages used in maritime navigation. Current version 3.0.0 (released 2024) with ~35% faster performance, requires Python >=3.9. No regular release cadence; version 2.x was stable for years.","status":"active","version":"3.0.0","language":"python","source_language":"en","source_url":"https://github.com/M0r13n/pyais","tags":["ais","maritime","nmea","decoder","encoding"],"install":[{"cmd":"pip install pyais","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"decode is a top-level function, not a submodule. Wrong import raises ModuleNotFoundError.","wrong":"from pyais.decode import decode","symbol":"decode","correct":"from pyais import decode"},{"note":"AISSentence is exported from pyais; accessing submodule path may break or not exist.","wrong":"from pyais.messages import AISSentence","symbol":"AISSentence","correct":"from pyais import AISSentence"},{"note":"Payload is a top-level export. Direct submodule import may fail.","wrong":"from pyais.payload import Payload","symbol":"Payload","correct":"from pyais import Payload"}],"quickstart":{"code":"from pyais import decode\n\n# NMEA 0183 AIS message string\nmsg = \"!AIVDM,1,1,,A,133m@ogP00PD;88MD5MTDww@2D7k,0*46\"\ndecoded = decode(msg)\nprint(decoded)\nprint(decoded.asdict())\n","lang":"python","description":"Decode a single AIS message from an NMEA 0183 sentence."},"warnings":[{"fix":"Replace .bit_array with .bv, .from_bitarray() with .from_vector(), .to_bitarray() with .to_bytes().","message":"v3.0.0 renamed AISSentence.bit_array to AISSentence.bv and Payload.from_bitarray() to Payload.from_vector(), Payload.to_bitarray() to Payload.to_bytes(). Code using old names will break.","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Do not rely on bitarray for pyais objects; use pyais's built-in bit vector.","message":"v3.0.0 removed the bitarray dependency; replaced with custom bit_vector. Imports like 'from bitarray import bitarray' may not work for pyais internals.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Catch generic Exception or use pyais's custom exceptions; avoid relying on NonPrintableCharacterException.","message":"NonPrintableCharacterException has been deprecated in v3.0.0 and may be removed in future.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Wrap decode() in try/except or validate checksum separately using pyais.checksum.","message":"decode() can raise pyais.exceptions.DecodingError if the message is malformed or checksum fails. New users may not handle exceptions.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from pyais import decode'.","cause":"Importing decode as a submodule instead of top-level function.","error":"ModuleNotFoundError: No module named 'pyais.decode'"},{"fix":"Replace 'bit_array' with 'bv'.","cause":"Using deprecated attribute from v2.x. In v3.0.0, 'bit_array' was renamed to 'bv'.","error":"AttributeError: 'AISSentence' object has no attribute 'bit_array'"},{"fix":"Ensure you pass a single NMEA sentence string to decode().","cause":"Calling decode on a list or forgetting to pass the sentence string.","error":"TypeError: decode() missing 1 required positional argument: 'sentence'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}