1
0
Fork 0
A simple python file to display the information of the ice-portal on the command line. https://lks.li/posts/2023-12-29-ice-portal/
Find a file
2024-09-01 21:40:01 +02:00
examples Initial commit 2024-09-01 21:40:01 +02:00
Pipfile Initial commit 2024-09-01 21:40:01 +02:00
Pipfile.lock Initial commit 2024-09-01 21:40:01 +02:00
README.md Initial commit 2024-09-01 21:40:01 +02:00
viz.py Initial commit 2024-09-01 21:40:01 +02:00

ice-info 🚆

A simple python file to display the information of the ice-portal on the command line. I hacked this together on the train from Hamburg to Basel in December 2023 while checking out the ICE-Portal. Read more about it in my blogpost.

Contents

  • viz.py - The "main" tool to visualize a trip to the terminal
  • examples/ - Some example payloads used for testing and developing

Usage

$ pip install
$ pipenv run python3 ./viz.py
Example Output
----- [   DB  Trip info  ] -----

  CURRENT INFO 

 Train: 🚆 : ICE (ICE9002)
 GPS 🛰️ : ✅
 Coords 🌍 : 47.58898666666666, 7.606424666666666 
 Internet 📡 : HIGH
 Speed 💨 : 38.0 km/h
 Restaurant 🧑‍🍳 : True

  STOPS 

 ✅ Hamburg Hbf (0%)
    🛬: 01:00  - 🛫: 15:41 +13 - 🛤️ : 13 
 ✅ Hamburg-Harburg (1%)
    🛬: 15:50 +13 - 🛫: 15:52 +13 - 🛤️ : 4 
 ✅ Lüneburg (6%)
    🛬: 16:09 +13 - 🛫: 16:11 +13 - 🛤️ : 1 
 ✅ Uelzen (10%)
    🛬: 16:24 +9 - 🛫: 16:27 +10 - 🛤️ : 301 instead of 101
 ✅ Celle (17%)
    🛬: 16:48 +11 - 🛫: 16:50 +11 - 🛤️ : 6 
 ✅ Hannover Hbf (22%)
    🛬: 17:07 +10 - 🛫: 17:12 +12 - 🛤️ : 3 instead of 4
 ✅ Göttingen (34%)
    🛬: 17:42 +1 - 🛫: 17:46 +2 - 🛤️ : 8 
 ✅ Kassel-Wilhelmshöhe (40%)
    🛬: 18:30  - 🛫: 18:38 +1 - 🛤️ : 2 
 ✅ Frankfurt(Main)Hbf (59%)
    🛬: 20:00  - 🛫: 20:06  - 🛤️ : 6 
 ✅ Mannheim Hbf (69%)
    🛬: 20:47 +3 - 🛫: 20:51 +5 - 🛤️ : 8 
 ✅ Karlsruhe Hbf (76%)
    🛬: 21:12 +3 - 🛫: 21:14 +2 - 🛤️ : 2 
 ✅ Baden-Baden (80%)
    🛬: 21:30 +2 - 🛫: 21:31 +2 - 🛤️ : 7 
 ✅ Offenburg (85%)
    🛬: 21:45  - 🛫: 21:47  - 🛤️ : 1 
 🛫 Freiburg(Breisgau) Hbf (92%)
    🛬: 22:15  - 🛫: 22:18 +1 - 🛤️ : 3 
 ⏳ Basel Bad Bf (99%)
    🛬: 22:51  - 🛤️ : 3 
 ⏳ Basel SBB (100%)
    🛬: 23:04  - 🛤️ : 12