Giter Club home page Giter Club logo

marey's Introduction

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

marey's People

Contributors

akazukin5151 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.