Skip to content

Analyzing the prices of the Deutsche Bahn (based on juliuste's project)

Notifications You must be signed in to change notification settings

SprickW/bahn-price-analyzer

 
 

Repository files navigation

bahn-price-analyzer

Analyzing the prices of the Deutsche Bahn (based on project juliuste/db-prices)

Small terminal application for the given API.

Getting started

You need: npm package manager and pip installer

Linux systems

  1. git clone [email protected]:frankzl/bahn-price-analyzer.git
  2. run setup.sh
  3. enjoy! :)

This will setup aliases in your system, allowing you to use short commands:

  • bahn to run the user program
  • bahn_info -f "Oldenburg (Oldb) Hbf" -t München Hbf -fd 2018-12-04 -td 2018-12-07 to query

Not sure if this works on macOS.. maybe someone can try it out

Otherwise:

  1. git clone [email protected]:frankzl/bahn-price-analyzer.git
  2. npm install
  3. pip install -r db_console/requirements.txt
  4. enjoy! :)

Requirements

  1. numpy 1.15.2
  2. colorama 0.3.9
  3. pandas v0.23.4
  4. Naked v0.1.31
  5. readline

Example commands

At the moment you can only specify the place by giving the exact station name, which can be found inside stations.csv. (still in progress, maybe we'll fix it with fuzzy matching)

python db_console/db_info.py -f "Oldenburg (Oldb) Hbf" -t "München Hbf" -fd 2018-12-15 -td 2018-12-24

demo screenshot

User program wrapper:

python db_console/db_user_program.py demo screenshot

Added autocomplete function!

Use tab to run autocompletion and show suggestions

demo screenshot

Node script

execute with node scrapper.js -f from_station -t to_station -s start_date -e end_date will write data into file:

data.csv

CSV file: data.csv

column names: date, hour, departure_time, arrival_time, stops, price, ticket_type, train_type

departure and arrival format: '2017-06-05T08:53:00.000Z'

Special Thanks

  1. Termgraph by makz for the amazingly simple terminal graph api.
  2. db-prices by juliuste for the db-price api which lets us fetch the ticket fares!
  3. Naked by chrissimpkins for the awesome library which lets us call our node script with ease!

About

Analyzing the prices of the Deutsche Bahn (based on juliuste's project)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 84.3%
  • JavaScript 12.8%
  • Shell 2.9%