Skip to content

Commit

Permalink
A bit more refactoring and hook up some cli functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pwoods25443 committed Sep 11, 2020
1 parent a828b3c commit 4447c75
Show file tree
Hide file tree
Showing 11 changed files with 809 additions and 408 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
# ais-tools
Tools for reading and writing AIS messages


## Install
```console
git clone https://github.com/SkyTruth/ais-tools
pip install ais-tools/
pip install git+https://github.com/GlobalFishingWatch/ais-tools
```
## Command line usage

```console
ais_tools --help
```

Decode nmea in a file as json to stdout
```
ais_tools decode ./sample/sample.nmea
```

## Python usage
Decode NMEA
```python
import json
from ais_tools.aivdm import AIVDM


nmea = [
'\\c:1599239526500,s:sdr-experiments,T:2020-09-04 18.12.06*5D\\!AIVDM,1,1,,A,B>cSnNP00FVur7UaC7WQ3wS1jCJJ,0*73',
'\\c:1599239587658,s:sdr-experiments,T:2020-09-04 18.13.07*58\\!AIVDM,1,1,,B,H>cSnNP@4eEL544000000000000,0*3E',
'\\c:1599239644720,s:sdr-experiments,T:2020-09-04 18.14.04*5E\\!AIVDM,1,1,,B,H>cSnNTU7B=40058qpmjhh000004,0*31',
]

decoder = AIVDM()

for msg in decoder.decode_stream(nmea):
print(json.dumps(msg))
```
## Developing

```console
Expand Down
Loading

0 comments on commit 4447c75

Please sign in to comment.