Skip to content

akazukin5151/marey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

train schedule diagram

status

A python script that scrapes ekitan (a Japanese transportation routing service) to make a train schedule diagram

chuo_normal

chuo_normal

chuo_delta

chuo_delta

chuo_delta_scatter

chuo_delta_scatter

chuo_delta_box

chuo_delta_box

chuo_sobu_normal

chuo_sobu_normal

chuo_sobu_delta

chuo_sobu_delta

chuo_sobu_delta_scatter

chuo_sobu_delta_scatter

chuo_sobu_delta_box

chuo_sobu_delta_box

keihin_tohoku_normal

keihin_tohoku_normal

keihin_tohoku_delta

keihin_tohoku_delta

keihin_tohoku_delta_scatter

keihin_tohoku_delta_scatter

keihin_tohoku_delta_box

keihin_tohoku_delta_box ueno_tokyo_normal

ueno_tokyo_normal

ueno_tokyo_delta

ueno_tokyo_delta

ueno_tokyo_delta_scatter

ueno_tokyo_delta_scatter

ueno_tokyo_delta_box

ueno_tokyo_delta_box

yamanote_normal

yamanote_normal

yamanote_delta

yamanote_delta

yamanote_delta_scatter

yamanote_delta_scatter

yamanote_delta_box

yamanote_delta_box

keihin_tohoku_ueno_tokyo_combined_delta

keihin_tohoku_ueno_tokyo_combined_delta

keihin_tohoku_ueno_tokyo_combined_delta_scatter

keihin_tohoku_ueno_tokyo_combined_delta_scatter

keihin_tohoku_ueno_tokyo_combined_delta_box

keihin_tohoku_ueno_tokyo_combined_delta_box

keihin_tohoku_ueno_tokyo_yamanote_combined_delta

keihin_tohoku_ueno_tokyo_yamanote_combined_delta

keihin_tohoku_ueno_tokyo_yamanote_combined_delta_scatter

keihin_tohoku_ueno_tokyo_yamanote_combined_delta_scatter

keihin_tohoku_ueno_tokyo_yamanote_combined_delta_box

keihin_tohoku_ueno_tokyo_yamanote_combined_delta_box

Journey with transfers

Ueno to Futako-Tamagawa

上野→二子玉川

Tanashi to Akihabara

田無→秋葉原

Features

  • Can start from any station, not just line terminus
  • Multiple plotters available
    • Non-interactive matplotlib
    • Interactive bokeh
    • Interactive Altair/Vega (Note: rather slow for large data sets)

Install dependencies

Install dependencies from pyproject.toml

Bokeh and Altair is optional, it is only used for interactive plots and depends on your choice

Using the simple app

python -m marey.app.simple.main

Either edit the bottom of marey/app/simple/main.py to use your own url and line name, and line color

Or from another python module, import main and call main.main(line), giving your own line. To construct a Line, import common from marey.app.simple and call common.Constants.Line

Note that your url should be pinned to a specific date, not current results. See:

All the scripts will try its best to immediately return if their output file already exists (regardless if the file is correct). To force the scripts to run, delete their output files

Using the transfers app

python -m marey.app.transfers.main

Either edit the bottom of marey/app/transfers/main.py to use your own url and filename

Or from another python module, import main and call main.main(route), giving your own route. To construct a Route, import common from marey.app.transfers and call common.Route

All the scripts will try its best to immediately return if their output file already exists (regardless if the file is correct). To force the scripts to run, delete their output files

Q&A

  • Why not use the JR website? Eg

Because it does not have arrival and departure time, only an instantaneous time

That link was no longer working for me. Turns out that they do indeed have arrival and departure time, eg. Ekitan still has the advantage of being a centralized source as it has data for non JR services, such as Tokyo Metro. While Tokyo Metro still has the same data available (eg), it means a different website to scrape, which makes the code less adaptable and flexible.

See also

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages