{"id":19684211,"url":"https://github.com/elliotwutingfeng/railrailrail","last_synced_at":"2025-04-29T05:32:23.534Z","repository":{"id":253221909,"uuid":"826039712","full_name":"elliotwutingfeng/railrailrail","owner":"elliotwutingfeng","description":"🚇 Route planner for all stages of the Singapore MRT/LRT rail network (1987-2040+).","archived":false,"fork":false,"pushed_at":"2024-11-08T02:06:58.000Z","size":1557,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-08T03:18:48.654Z","etag":null,"topics":["bplrt","ccl","crl","dtl","ewl","jrl","metro","nel","nsl","pglrt","rapid","sbs-transit","sklrt","smrt","subway","tel","transit"],"latest_commit_sha":null,"homepage":"https://panda.observer/singapore-mrt-2040","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotwutingfeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-07-09T02:10:54.000Z","updated_at":"2024-11-08T02:06:49.000Z","dependencies_parsed_at":"2024-08-29T20:38:31.973Z","dependency_job_id":"8fb31ba0-a225-4bd7-aa54-f690ca1d847b","html_url":"https://github.com/elliotwutingfeng/railrailrail","commit_stats":null,"previous_names":["elliotwutingfeng/railrailrail"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Frailrailrail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Frailrailrail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Frailrailrail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Frailrailrail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotwutingfeng","download_url":"https://codeload.github.com/elliotwutingfeng/railrailrail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224151083,"owners_count":17264436,"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":["bplrt","ccl","crl","dtl","ewl","jrl","metro","nel","nsl","pglrt","rapid","sbs-transit","sklrt","smrt","subway","tel","transit"],"created_at":"2024-11-11T18:17:07.326Z","updated_at":"2025-04-29T05:32:23.522Z","avatar_url":"https://github.com/elliotwutingfeng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003erailrailrail\u003c/h3\u003e\n  \u003cimg src=\"images/train.svg\" alt=\"Train\" width=\"200\" height=\"200\"\u003e\n\n  \u003cp align=\"center\"\u003e\n  Route planner for all stages of the Singapore MRT/LRT rail network (1987-2040+).\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n  \u003ca href=\"https://python.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-FFD43B?style=for-the-badge\u0026logo=python\u0026logoColor=blue\" alt=\"Python\"/\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/SOURCE_CODE_LICENSE-Apache--2.0-GREEN?style=for-the-badge\" alt=\"Apache-2.0 license\"/\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE-DATASET.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/DATASET_LICENSE-SODL--1.0-GREEN?style=for-the-badge\" alt=\"SODL-1.0 License\"/\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nrailrailrail finds fastest routes between any 2 stations on the Singapore MRT/LRT rail network. It supports all known past and future stages of the network (1987-2040+).\n\n## Features\n\n- Preset configurations for all known stages of the MRT/LRT network, in the [TOML](https://toml.io) file format.\n- Customize every station-to-station travel time, interchange transfer time, and station dwell time, by editing the TOML config file directly.\n- Optionally enable walking routes between nearby stations.\n- Find the circuity ratio of a fastest route. The circuity ratio is the total distance travelled divided by the [great-circle (haversine) distance](https://en.wikipedia.org/wiki/Great-circle_distance) between origin station and destination station. Smaller circuity ratio implies a more direct and efficient route.\n\n## Requirements\n\n- Python 3.12+\n- [uv](https://docs.astral.sh/uv) 0.6.16+\n- GNU Make\n\nWorks natively on a POSIX/UNIX-like environment like Linux/macOS. Windows users should use the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install).\n\n## Setup\n\nInstall dependencies. Then generate a coordinates file (station_coordinates.csv), and network config files for all stages.\nThese files will be saved to the `config/` folder.\n\n```bash\nmake install\nmake generate_config\n```\n\n## Basic Usage\n\nNow lets find the fastest route between Pasir Ris and Hougang in 2003.\n\n```bash\nuv run python railrailrail/cli.py route --network-file config/network_nel.toml --coordinates-file config/station_coordinates.csv --start EW1 --end NE14\n\n# Start at EW1 Pasir Ris\n# Board train towards terminus EW27 Boon Lay\n# Alight at EW13 City Hall\n# Transfer to NS25 City Hall\n# Board train towards terminus NS1 Jurong East\n# Alight at NS24 Dhoby Ghaut\n# Transfer to NE6 Dhoby Ghaut\n# Board train towards terminus NE17 Punggol\n# Alight at NE14 Hougang\n# Total duration: 61 minutes 28 seconds\n# Approximate path distance: 28.1 km, Haversine distance: 6.3 km, Circuity ratio: 4.4\n```\n\nIn 2024.\n\n```bash\nuv run python railrailrail/cli.py route --network-file config/network_tel_4.toml --coordinates-file config/station_coordinates.csv --start EW1 --end NE14\n\n# Start at EW1 Pasir Ris\n# Board train towards terminus EW33 Tuas Link\n# Alight at EW8 Paya Lebar\n# Transfer to CC9 Paya Lebar\n# Board train towards terminus CC29 HarbourFront\n# Alight at CC13 Serangoon\n# Transfer to NE12 Serangoon\n# Board train towards terminus NE17 Punggol\n# Alight at NE14 Hougang\n# Total duration: 49 minutes 26 seconds\n# Approximate path distance: 19.6 km, Haversine distance: 6.3 km, Circuity ratio: 3.1\n```\n\nIn 2030.\n\n```bash\nuv run python railrailrail/cli.py route --network-file config/network_crl_1.toml --coordinates-file config/station_coordinates.csv --start EW1 --end NE14\n\n# Start at EW1 Pasir Ris\n# Transfer to CR5 Pasir Ris\n# Board train towards terminus CR13 Bright Hill\n# Alight at CR8 Hougang\n# Transfer to NE14 Hougang\n# Total duration: 13 minutes 41 seconds\n# Approximate path distance: 7.3 km, Haversine distance: 6.3 km, Circuity ratio: 1.1\n```\n\n## Customization\n\nThe generated network config files (ending with `.toml`) and the station coordinates file (**station_coordinates.csv**) in the `config`\nfolder can be customized. See [CONFIG.md](docs/CONFIG.md).\n\n## Commands\n\nSee [COMMANDS.md](docs/COMMANDS.md).\n\n## Misc\n\nSee [MISC.md](docs/MISC.md).\n\n## Analysis\n\nA Jupyter notebook for analysing the route planner output is available at [analysis.ipynb](analysis/analysis.ipynb).\n\n## License\n\nSource code is under Apache-2.0. Most of the datasets are under the Singapore Open Data Licence version 1.0.\n\nSee [LICENSE](LICENSE) and [LICENSE-DATASET.md](LICENSE-DATASET.md).\n\n## References\n\n- Train Spotters from YouTube\n  - [Link](docs/TRAIN_SPOTTERS.md)\n- Measured interchange transfer times by a deleted user on Reddit\n  - [Reddit post](https://www.reddit.com/r/singapore/comments/10wkygf/mrt_map_with_transfer_timing)\n  - [Timetable](https://docs.google.com/spreadsheets/d/1e-Tuf6rHBFsgsuFN7XqbFL8ec_vdRjQw)\n- TransitLink\n  - [MRT/LRT Journey Information](https://www.transitlink.com.sg/eservice/eguide/rail_idx.php)\n- SMRT\n  - [SMRT Journey Planner](https://journey.smrt.com.sg)\n- SBS Transit\n  - [Travel Time](https://www.sbstransit.com.sg/travel-time)\n- Singapore Train Station Coordinates\n  - [GitHub Repo](https://github.com/elliotwutingfeng/singapore_train_station_coordinates)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotwutingfeng%2Frailrailrail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotwutingfeng%2Frailrailrail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotwutingfeng%2Frailrailrail/lists"}