{"id":16133103,"url":"https://github.com/aschuma/vvs_direct_connect","last_synced_at":"2025-03-18T15:30:57.621Z","repository":{"id":38807760,"uuid":"334474868","full_name":"aschuma/vvs_direct_connect","owner":"aschuma","description":"A Docker-based REST service that offers real-time departure information for a dedicated VVS connection of the local public transport system in Stuttgart","archived":false,"fork":false,"pushed_at":"2024-05-22T06:06:58.000Z","size":408,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-22T07:26:18.431Z","etag":null,"topics":["departures","docker-image","public-transport","rest-api","stuttgart","vvs","vvs-api"],"latest_commit_sha":null,"homepage":"","language":"Python","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/aschuma.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}},"created_at":"2021-01-30T17:44:46.000Z","updated_at":"2024-05-22T07:26:21.657Z","dependencies_parsed_at":"2024-05-06T20:52:17.888Z","dependency_job_id":null,"html_url":"https://github.com/aschuma/vvs_direct_connect","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fvvs_direct_connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fvvs_direct_connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fvvs_direct_connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fvvs_direct_connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aschuma","download_url":"https://codeload.github.com/aschuma/vvs_direct_connect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221713502,"owners_count":16868262,"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":["departures","docker-image","public-transport","rest-api","stuttgart","vvs","vvs-api"],"created_at":"2024-10-09T22:37:02.473Z","updated_at":"2024-10-27T17:53:31.546Z","avatar_url":"https://github.com/aschuma.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CodeQL](https://github.com/aschuma/vvs_direct_connect/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/aschuma/vvs_direct_connect/actions/workflows/codeql-analysis.yml) [![docker](https://github.com/aschuma/vvs_direct_connect/actions/workflows/docker.yml/badge.svg)](https://github.com/aschuma/vvs_direct_connect/actions/workflows/docker.yml)\n\n\n# VVS Direct Connect REST Service\nSimple REST service providing connection data for a dedicated VVS connection. VVS is the local public transport in Stuttgart. \n\nThe REST endpoints `/api/v1/` and `/` (this is an alias for `/api/v1/`) exclusively handle direct connections. Additionally, the `/api/v2/` endpoint supports interchange stations.\n\n## Start Server\n```shell\n$ docker run --rm -p15151:15151 -ti \\\n   -e VVS_FROM=de:08111:6118 \\\n   -e VVS_TO=de:08116:7800 \\\n   aschuma/vvs_direct_connect:latest\n\n----- VVS Direct Connect -----------------------------------\nCopyright (c) 2021-2024 aschuma (https://github.com/aschuma)\n------------------------------------------------------------\n\nSettings:\n\t- VVS_FROM=de:08111:6118\n\t- VVS_TO=de:08116:7800\n\t- VVS_LIMIT=10\n\t- VVS_TIME_OFFSET_MINUTES=12\n\n```\n\nSupported platforms:\n\n* linux/amd64\n* linux/arm64\n* linux/arm/v7 (PI 4B)\n\n## Call Rest Endpoint\n\n⚠️ Kindly note that the default port has been updated to 15151.\n\n```shell\n$ curl 127.0.0.1:15151/api/v2/\n\n{\n  \"status\": 200,\n  \"trips\": [\n    {\n      \"arrival_delay\": 0,\n      \"arrival_estimated\": \"2024-04-02T09:14:00Z\",\n      \"arrival_planed\": \"2024-04-02T09:14:00Z\",\n      \"departure_delay\": 0,\n      \"departure_estimated\": \"2024-04-02T09:03:00Z\",\n      \"departure_planned\": \"2024-04-02T09:03:00Z\",\n      \"details\": [\n        {\n          \"arrival_estimated\": \"2024-04-02T09:14:00Z\",\n          \"arrival_planed\": \"2024-04-02T09:14:00Z\",\n          \"departure_estimated\": \"2024-04-02T09:03:00Z\",\n          \"departure_planed\": \"2024-04-02T09:03:00Z\",\n          \"from\": \"Stuttgart Hauptbahnhof (oben)\",\n          \"from_id\": \"de:08111:6115:6:12\",\n          \"number\": \"MEX16\",\n          \"to\": \"Esslingen (N)\",\n          \"to_id\": \"de:08116:7800:2:5\"\n        }\n      ],\n      \"from\": \"Stuttgart Hauptbahnhof (oben)\",\n      \"from_id\": \"de:08111:6115:6:12\",\n      \"number\": \"MEX16\",\n      \"numbers\": [\n        \"MEX16\"\n      ],\n      \"to\": \"Esslingen (N)\",\n      \"to_id\": \"de:08116:7800:2:5\",\n      \"travel_time\": 11\n    },\n    {\n      \"arrival_delay\": 0,\n      \"arrival_estimated\": \"2024-04-02T09:27:00Z\",\n      \"arrival_planed\": \"2024-04-02T09:27:00Z\",\n      \"departure_delay\": 1,\n      \"departure_estimated\": \"2024-04-02T09:11:00Z\",\n      \"departure_planned\": \"2024-04-02T09:10:00Z\",\n      \"details\": [\n        {\n          \"arrival_estimated\": \"2024-04-02T09:27:00Z\",\n          \"arrival_planed\": \"2024-04-02T09:27:00Z\",\n          \"departure_estimated\": \"2024-04-02T09:11:00Z\",\n          \"departure_planed\": \"2024-04-02T09:10:00Z\",\n          \"from\": \"Stuttgart Hauptbahnhof (tief)\",\n          \"from_id\": \"de:08111:6118:1:102\",\n          \"number\": \"S1\",\n          \"to\": \"Esslingen (N)\",\n          \"to_id\": \"de:08116:7800:1:8\"\n        }\n      ],\n      \"from\": \"Stuttgart Hauptbahnhof (tief)\",\n      \"from_id\": \"de:08111:6118:1:102\",\n      \"number\": \"S1\",\n      \"numbers\": [\n        \"S1\"\n      ],\n      \"to\": \"Esslingen (N)\",\n      \"to_id\": \"de:08116:7800:1:8\",\n      \"travel_time\": 17\n    },\n    {\n      \"arrival_delay\": 0,\n      \"arrival_estimated\": \"2024-04-02T09:42:00Z\",\n      \"arrival_planed\": \"2024-04-02T09:42:00Z\",\n      \"departure_delay\": 1,\n      \"departure_estimated\": \"2024-04-02T09:26:00Z\",\n      \"departure_planned\": \"2024-04-02T09:25:00Z\",\n      \"details\": [\n        {\n          \"arrival_estimated\": \"2024-04-02T09:42:00Z\",\n          \"arrival_planed\": \"2024-04-02T09:42:00Z\",\n          \"departure_estimated\": \"2024-04-02T09:26:00Z\",\n          \"departure_planed\": \"2024-04-02T09:25:00Z\",\n          \"from\": \"Stuttgart Hauptbahnhof (tief)\",\n          \"from_id\": \"de:08111:6118:1:102\",\n          \"number\": \"S1\",\n          \"to\": \"Esslingen (N)\",\n          \"to_id\": \"de:08116:7800:1:8\"\n        }\n      ],\n      \"from\": \"Stuttgart Hauptbahnhof (tief)\",\n      \"from_id\": \"de:08111:6118:1:102\",\n      \"number\": \"S1\",\n      \"numbers\": [\n        \"S1\"\n      ],\n      \"to\": \"Esslingen (N)\",\n      \"to_id\": \"de:08116:7800:1:8\",\n      \"travel_time\": 17\n    },\n    {\n      \"arrival_delay\": 0,\n      \"arrival_estimated\": \"2024-04-02T09:48:00Z\",\n      \"arrival_planed\": \"2024-04-02T09:48:00Z\",\n      \"departure_delay\": 0,\n      \"departure_estimated\": \"2024-04-02T09:39:00Z\",\n      \"departure_planned\": \"2024-04-02T09:39:00Z\",\n      \"details\": [\n        {\n          \"arrival_estimated\": \"2024-04-02T09:48:00Z\",\n          \"arrival_planed\": \"2024-04-02T09:48:00Z\",\n          \"departure_estimated\": \"2024-04-02T09:39:00Z\",\n          \"departure_planed\": \"2024-04-02T09:39:00Z\",\n          \"from\": \"Stuttgart Hauptbahnhof (oben)\",\n          \"from_id\": \"de:08111:6115:8:15\",\n          \"number\": \"RE5\",\n          \"to\": \"Esslingen (N)\",\n          \"to_id\": \"de:08116:7800:2:5\"\n        }\n      ],\n      \"from\": \"Stuttgart Hauptbahnhof (oben)\",\n      \"from_id\": \"de:08111:6115:8:15\",\n      \"number\": \"RE5\",\n      \"numbers\": [\n        \"RE5\"\n      ],\n      \"to\": \"Esslingen (N)\",\n      \"to_id\": \"de:08116:7800:2:5\",\n      \"travel_time\": 9\n    }\n  ]\n}\n\n```\n## Parameter\n\n- `VVS_FROM` departure station id \n- `VVS_TO` destination station id \n- `VVS_LIMIT` max number of trips to fetch\n- `VVS_TIME_OFFSET_MINUTES` walking distance to departure station\n\n## Obtaining the Station IDs\n\nPlease consult [https://www.openvvs.de/dataset/haltestellen](https://www.openvvs.de/dataset/haltestellen) to identify the origin and destination stations. \n\nAlternatively, you can use the online timetable information to get the IDs. To do so, open VVS [https://www3.vvs.de/](https://www3.vvs.de/) in your browser. Enter origin and destination stations and click submit, e.g. `origin=Stuttgart` and `destination=Esslingen`:\n\n![VVS](https://raw.githubusercontent.com/aschuma/vvs_direct_connect/main/doc/010_search.png)\n\nCopy the Browser URL into a text editor:\n\n![Search](https://raw.githubusercontent.com/aschuma/vvs_direct_connect/main/doc/020_url.png)\n\nSearch for the `orig`and `dest`parameters and the associated values. In this case `de:08111:6118` is the ID of the origin station (Stuttgart).  The ID of the destination station (Esslingen) is `de:08116:7800`.\n\n![URL](https://raw.githubusercontent.com/aschuma/vvs_direct_connect/main/doc/030_url_parameter.png)\n\n## Address Support - Obtaining the Street IDs\n\nThe REST endpoint `/api/v2` additionally provides also some support for addresses within the VVS area. The format for the address _Konrad Adenauer Str 32_ (Staatsgalerie) is as follows: `streetID:1500001775:32:8111000:51:Konrad-Adenauer-Straße:Stuttgart:Konrad-Adenauer-Straße::Konrad-Adenauer-Straße:70173:ANY:DIVA_SINGLEHOUSE:3513826:755185:NBWT:VVS:0`.\n\nYou can also obtain the corresponding value through a VVS query as described above.\n\n## Credits\nCredits to [Yannick](https://github.com/zaanposni) for [vvspy](https://pypi.org/project/vvspy/)\n\n## Further Information\n* [https://www.openvvs.de/](https://www.openvvs.de/)\n* [https://www.openvvs.de/dataset/haltestellen](https://www.openvvs.de/dataset/haltestellen)\n* [https://www.vdv.de/ip-kom-oev.aspx](https://www.vdv.de/ip-kom-oev.aspx)\n* [https://github.com/VDVde/TRIAS](https://github.com/VDVde/TRIAS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschuma%2Fvvs_direct_connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faschuma%2Fvvs_direct_connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschuma%2Fvvs_direct_connect/lists"}