Giter Club home page Giter Club logo

db_scripts's Introduction

Deutsche Bahn Delay Scanner

This project measures train delays at Germany's biggest train stations.

Getting started

Get your own data

  1. Clone this repo.
  2. Install dependencies, preferrably in a virtual environment.
pip install -r requirements.txt
  1. Run setup.py to create the database and get static information on train stations.
python setup.py
  1. Get a free Deutsche Bahn API key.
  2. Add your API Key to api_keys.txt at the line starting with dbapi = "".
  3. Run update_trips.py to collect data for trips at train stations of the first category in Germany at this moment.
python update_trips.py

Test with sample data instead
If you want to run an analysis without collecting your own data, you can download a database with sample data. The data was collected in 30 minute intervals with cronjobs running on a raspberry pi.

Explore
The notebook exploration.ipynb shows how the data is structured within the database.

Optional Weather Data
You can collect weather data to find out how delays are related to the local weather. Add an API key for OpenWeather.com to api_keys.txt and every time you execute update_trips.py also run

python update_weather.py

Author

Hannes Knobloch - Rubbedikatz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.