All Projects → pirpyn → pyAISm

pirpyn / pyAISm

Licence: MIT License
A small and easy python-only decoder-only for AIS messages : AIVDM/AIVDO

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pyAISm

bs-decode
Type-safe JSON decoding for ReasonML and OCaml
Stars: ✭ 105 (+452.63%)
Mutual labels:  decoding
JSONUtilities
Easily load JSON objects and decode them into structs or classes
Stars: ✭ 57 (+200%)
Mutual labels:  decoding
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (+5.26%)
Mutual labels:  decoding
go-webp
Simple and fast webp library for golang
Stars: ✭ 91 (+378.95%)
Mutual labels:  decoding
pycayennelpp
A Cayenne Low Power Payload (CayenneLPP) decoder and encoder for Python
Stars: ✭ 17 (-10.53%)
Mutual labels:  decoding
fs2-mail
asynchronous library for sending and receiving mail via fs2._
Stars: ✭ 39 (+105.26%)
Mutual labels:  decoding
re-typescript
An opinionated attempt at finally solving typescript interop for ReasonML / OCaml.
Stars: ✭ 68 (+257.89%)
Mutual labels:  decoding
reisen
A simple library to extract video and audio frames from media containers (based on libav).
Stars: ✭ 41 (+115.79%)
Mutual labels:  decoding
universal-base64
Small universal base64 functions for node.js and browsers
Stars: ✭ 25 (+31.58%)
Mutual labels:  decoding
go-fixedwidth
Encoding and decoding for fixed-width formatted data
Stars: ✭ 64 (+236.84%)
Mutual labels:  decoding
d3coder
Chrome extension for encoding/decoding and hashing text on websites
Stars: ✭ 26 (+36.84%)
Mutual labels:  decoding
pyMHT
Track oriented, multi target, multi hypothesis tracker
Stars: ✭ 66 (+247.37%)
Mutual labels:  ais
planesailing
Plane✈/Sailing⛵ - Completely unnecessary military situational awareness display for your home
Stars: ✭ 29 (+52.63%)
Mutual labels:  ais
BeFoR64
BeFoR64, Base64 encoding/decoding library for FoRtran poor men
Stars: ✭ 17 (-10.53%)
Mutual labels:  decoding
ais-simulator
Create and transmit AIS frames via gnuradio toolchain and web application in browser. Provides a websocket to PDU message block to change frame content on runtime. Works in burst mode, a frame is send on change immediately, one time. Transmitter remains silent until next change event.
Stars: ✭ 16 (-15.79%)
Mutual labels:  ais
Symbolic-Regression
predicting equations from raw data with deep learning
Stars: ✭ 48 (+152.63%)
Mutual labels:  decoding
gleam decode
Transform Erlang or Elixir data into Gleam data
Stars: ✭ 25 (+31.58%)
Mutual labels:  decoding
velvet-video
Java library for encoding / decoding / muxing / demuxing video and audio in various formats
Stars: ✭ 32 (+68.42%)
Mutual labels:  decoding
avro ex
An Avro Library that emphasizes testability and ease of use.
Stars: ✭ 47 (+147.37%)
Mutual labels:  decoding
cpp-bencoding
A C++ bencoding library supporting both decoding and encoding.
Stars: ✭ 20 (+5.26%)
Mutual labels:  decoding

pyAISm

A small and incomplete python decoder for AIS messaging.

A bunch of naive pythons functions to decode somes ais_data/AIVDM messages:

Based on the doc here: (http://catb.org/gpsd/AIVDM.html).

How to use it

In python 2 console:

> msg = '!AIVDO,1,1,,,B00000000868rA6<H7KNswPUoP06,0*6A'  # standard AIVDO sentence as a string
> ais_data = decod_ais(msg)         # Return a dictionnary
> ais_format = format_ais(ais_data) # A more human readable dictionnary
> print ais_data, ais_data['lon'], ais_format['lon'] # Accessing the value of the key

Decode a file:

def decode_file_example():
    """
    Example for decoding a file
    :return:
    """
    with open("ais.exploratorium.edu", "r") as file:
        for aline in file:
            try:
                msg = aline.rstrip("\n")
                ais_data = pyAISm.decod_ais(msg)  # Return a dictionnary
                ais_format = pyAISm.format_ais(ais_data)  # A more human readable dictionnary
                print(ais_format)  # Accessing the value of the key
            except pyAISm.UnrecognizedNMEAMessageError as e:
                print e
            except pyAISm.BadChecksumError as e:
                print e
            except Exception as e:
                print e
        print('End of file')

Decode a stream:

def decode_stream_example():
    """
    Example for decoding an online data stream
    :return:
    """
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect(("ais.exploratorium.edu", 80))
    s.sendall("GET / HTTP/1.1\r\nHost: www.cnn.com\r\n\r\n".encode())
    while (True):
        msg = (s.recv(4096).decode('utf-8')).splitlines()
        for m in msg:
            try:
                msg = m.rstrip("\n")
                ais_data = pyAISm.decod_ais(msg)  # Return a dictionnary
                ais_format = pyAISm.format_ais(ais_data)  # A more human readable dictionnary
                print(ais_format)  # Accessing the value of the key
            except pyAISm.UnrecognizedNMEAMessageError as e:
                print e
            except pyAISm.BadChecksumError as e:
                print e
            except Exception as e:
                print e
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].