{"id":22720674,"url":"https://github.com/piebro/deutsche-bahn-statistics","last_synced_at":"2025-07-09T04:34:37.428Z","repository":{"id":266826339,"uuid":"898529026","full_name":"piebro/deutsche-bahn-statistics","owner":"piebro","description":"A Deutsche Bahn statistics website (in German) with plots and tables about train delays, connections, and other railway metrics.","archived":false,"fork":false,"pushed_at":"2025-07-01T16:50:23.000Z","size":56729,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T17:45:31.271Z","etag":null,"topics":["data-visualization","deutsche-bahn","germany","statistics"],"latest_commit_sha":null,"homepage":"https://piebro.github.io/deutsche-bahn-statistics/questions/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piebro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-04T14:59:47.000Z","updated_at":"2025-07-01T16:50:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"90aaf673-4327-4460-8124-e96c6ace4e14","html_url":"https://github.com/piebro/deutsche-bahn-statistics","commit_stats":null,"previous_names":["piebro/deutsche-bahn-statistics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/piebro/deutsche-bahn-statistics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piebro%2Fdeutsche-bahn-statistics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piebro%2Fdeutsche-bahn-statistics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piebro%2Fdeutsche-bahn-statistics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piebro%2Fdeutsche-bahn-statistics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piebro","download_url":"https://codeload.github.com/piebro/deutsche-bahn-statistics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piebro%2Fdeutsche-bahn-statistics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264394712,"owners_count":23601352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization","deutsche-bahn","germany","statistics"],"created_at":"2024-12-10T14:11:55.166Z","updated_at":"2025-07-09T04:34:37.405Z","avatar_url":"https://github.com/piebro.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deutsche Bahn Statistics\n\nDeutsche Bahn Statistics is a (German) [website](https://piebro.github.io/deutsche-bahn-statistics/questions) with plots and tables about the Deutsche Bahn together with Python code to create them.\nThe statistics are automatically updated monthly and use publicly available data.\nThe data is available in a separate repo here: [https://github.com/piebro/deutsche-bahn-data](https://github.com/piebro/deutsche-bahn-data).\n\n## Develop\n\n### Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/piebro/deutsche-bahn-statistics\n   cd deutsche-bahn-data\n   ```\n\n2. Install the required dependencies in a virtual environment using [uv](https://docs.astral.sh/uv/getting-started/installation/):\n   ```bash\n   uv sync\n   ```\n\n3. Download the data files:\n   ```bash\n   bash download_data.sh\n   ```\n\n4. Host the website locally:\n   ```bash\n   uv run -m http.server\n   ```\n\n### Update Statistics Manually\n\n```bash\nuv run run_all_calculations.py\n```\n\n### Add a new Question\n\nDo it manually and copy the folder structure of the previous question.\nAn overview of the dataset with its columns can be found in the [data repository](https://github.com/piebro/deutsche-bahn-data).\n\nUpdate all the generated parts of index.html using the following script, after adding a new question.\n```bash\nSTART_DATE=$(date -d \"$(date +%Y-%m-01) -3 month\" +%Y.%m.%d)\nEND_DATE=$(date +%Y.%m.01)\nuv run generate_html_links.py $START_DATE $END_DATE \"allgemein,zeitraum,direkter_zug,zugverbindung,verspaetungsverlauf_zugfahrt,verspaetung_pro_bahnhof,zuggattungen_pro_bahnhof,bahnhof,zuggattung\"\n```\n\nUse `ruff check` and `ruff format` to lint and format the Python code before committing new code.\n\n## Related Deutsche Bahn and Open Data Websites\n\nThere are a few other projects that look at similar data.\n- [Video](https://www.youtube.com/watch?v=0rb9CfOvojk): BahnMining - Pünktlichkeit ist eine Zier (David Kriesel) [2019]\n- [www.deutschebahn.com](https://www.deutschebahn.com/de/konzern/konzernprofil/zahlen_fakten/puenktlichkeitswerte-6878476#): official statistics from Deutsche Bahn\n- [bahn.expert](https://bahn.expert): look at the departure monitor of train stations in real time\n- [next.bahnvorhersage.de](https://next.bahnvorhersage.de): a tool to calculate the probability that a train connection works using historical data\n- [www.zugfinder.net](https://www.zugfinder.net/de/start): multiple maps of current train positions and statistics for long-distance trains in Germany, Austria, BeNeLux, Denmark, Italy and Slovenia\n- [strecken-info.de](https://strecken-info.de/): a map of the German railroads with current construction sites and disruptions on the routes\n- [openrailwaymap.org](https://openrailwaymap.org/): a worldwide map with railway infrastructure using OpenStreetMap Data\n\n## Contributing\n\nContributions are welcome. Open an Issue if you want to report a bug, have an idea, or want to propose a change.\n\n## Website Statistics\n\nThere is lightweight tracking with [Plausible](https://plausible.io/about) for the [website](https://piebro.github.io/deutsche-bahn-statistics/) to get info about how many people are visiting.\nEveryone who is interested can look at these stats here: https://plausible.io/piebro.github.io%2Fdeutsche-bahn-statistics?period=30d.\nOnly users without an AdBlocker are counted, so these statistics are underestimating the actual count of visitors.\nI would guess that quite a few people (including me) visiting the site have an AdBlocker.\n\n## License\n\nAll code in this project is licensed under the MIT License.\nThe [data](https://developers.deutschebahn.com/db-api-marketplace/apis/product/timetables) is licensed under [Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) by Deutsche Bahn.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiebro%2Fdeutsche-bahn-statistics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiebro%2Fdeutsche-bahn-statistics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiebro%2Fdeutsche-bahn-statistics/lists"}