Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
/ nsclock Public archive

NS (Nederlandse Spoorwegen - Dutch rail service) departure timetables for Linux/macOS CLI and PaPiRus ePaper displays

License

Notifications You must be signed in to change notification settings

theodric/nsclock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nsclock

NS (Nederlandse Spoorwegen - Dutch rail service) departure timetables for terminals and PaPiRus ePaper displays, in Python

NOTE: this died 1 API update ago, and I no longer live in the Netherlands, so I am archiving the repo for posterity.

nsclock.py

Prints the next up to four trains, from a configurable start point, to a configurable destination or two, on a PaPiRus ePaper screen attached to a Raspberry Pi (Zero).

normal run exception

nscliclock.py

Prints the same information as above to your terminal.

normal CLI run

Usage:

Step zero, register for an NS API key (free), copy the provided settings_example.py to settings.py, and populate it with the credentials you are provided by NS. The scripts will not work without this key.

Then, install required libraries.

pip install -r requirements.txt

If you are using nsclock.py, also manually install the 'papirus' library and dependencies as instructed by the documentation at https://github.com/PiSupply/PaPiRus

Then, just run in a terminal (or call with cron).

./nsclock.py

or

./nscliclock.py

The scripts are commented and contain a number of configurable variables which you can use to customize them to be useful to your own situation, e.g. start and end stations, etc.

nsclock.py requires Python 2.7, because as of 2017-07-01 there was no available LM75B temperature sensor library for Python 3, and the PaPiRus screen uses such a sensor.

Credits

This script makes use of the NS API, documented extensively here: http://www.ns.nl/en/travel-information/ns-api

Small pieces of code related to ePaper screen setup stolen whole from demo scripts included with PaPiRus

I owe thanks to:

Google

stackoverflow

SoloLearn

+friends willing to answer my daft questions.

About

NS (Nederlandse Spoorwegen - Dutch rail service) departure timetables for Linux/macOS CLI and PaPiRus ePaper displays

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages