Skip to content

This is a system which checks the IrishRail API continuously and monitors train movements in real time, writing this data constantly, from within a Docker container, to a DB (MySQL or PostgreSQL). It is designed to be run using Docker. The data can then be used to perform data analysis on train movements over time.

Notifications You must be signed in to change notification settings

cohaolain/ContainerisedIrishRailDataCapture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IrishRail Train Data Logger

Setup

Here's everything you need to run this on your own.

Prerequisites

  • Configured MySQL/PostgreSQL database
  • Python 3 if running without Docker
  • Can also be run using a Docker image

Preparing the database

In the case of MySQL, to set up a server simply do the following:

λ sudo apt install mysql-server

followed by

mysql>  CREATE DATABASE irishrail_logger;
Query OK, 1 row affected (0.00 sec)

mysql>  CREATE USER irishrail_logger
        IDENTIFIED BY 'supersecretpassword';
Query OK, 0 rows affected (0.01 sec)

mysql>  GRANT ALL PRIVILEGES ON irishrail_logger.*
        to 'irishrail_logger'@'localhost';
Query OK, 0 rows affected, 1 warning (0.00 sec)

Then populate .env in the same format as .sample_env with your DB details.

  • If running with Docker, run docker run --net=host --env-file=.env -d irishrail-logger.
  • If running without Docker, run python3 logger.py.

About

This is a system which checks the IrishRail API continuously and monitors train movements in real time, writing this data constantly, from within a Docker container, to a DB (MySQL or PostgreSQL). It is designed to be run using Docker. The data can then be used to perform data analysis on train movements over time.

Resources

Stars

Watchers

Forks

Packages

No packages published