Skip to content

Python tool scraping and collecting terrestrial AIS streaming data (visualization, API usage tracking, ...)

Notifications You must be signed in to change notification settings

lcsrodriguez/AIS-ws-feedhandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIS WS feedhandler

  GitHub release (latest by date) python version | 3.10+ Code style: black

Overview

This tool allows the user to gather, store, process and track usage of AIS data collection.

It can also be used to simulate a real-time data source to better handle streaming.

Data provided by the AISStream.io API. To use it, please sign up using your GitHub account here.

AISStream is used to:

Track ship movements, monitor maritime accidents and discover ship's cargo...

The API offers access to various kind of messages for the AIS1 protocol:

  • Ship Property and Voyage Data
  • SAR Aircraft Position
  • Accident And Danger Reports
  • Binary Ship To Ship Messages
  • ...

Features

Example

Project's architecture

.
├── AIS/
│   ├── Config.py
│   ├── Scraper.py
│   ├── Usage.py
│   ├── __init__.py
│   ├── constants.py
│   └── utils.py
├── Makefile
├── README.md
├── assets/
│   ├── _empty.config.toml
│   └── img
├── config.toml
├── examples/
│   └── script.py
├── out/
│   ├── cookies
│   ├── plots
│   └── usages
├── requirements.txt
└── setup.py

To reproduce the file tree, run: tree -L 2 -I '*.csv|*.log'

Getting started

git clone https://github.com/lcsrodriguez/AIS-ws-feedhandler.git
cd AIS-ws-feedhandler/

python3 -m venv .venv
source .venv/bin/activate

pip3 install -r requirements.txt
pip3 freeze

python3 setup.py sdist bdist_wheel # Build the package from source

Run the example script:

python3 examples/script.py

config.toml file structure

[local]
api.secret_key = "<AISSTREAM API KEY HERE>"
gh.username="<GH_USERNAME HERE>"
gh.password="<GH_PASSWORS HERE>"

[dev]
api.secret_key = ""

[uat]
api.secret_key = ""

[prod]
api.secret_key = ""

License

MIT

Footnotes

  1. AIS is a broadcast system that transmits the unique identification, position, course, and speed, on a vessel