Skip to content
No description, website, or topics provided.
Jupyter Notebook HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
COPYRIGHT_NOTICE.txt
LICENSE
README.md
REQUIREMENTS.txt
generate_nice_timetables.ipynb
timetable.png
timetable_template.html

README.md

generate-nice-timetables

The project contains a Jupyter Notebook to get the transit schedule between a given origin-destination pair on a given date from the Google Directions API.

Requirements

In addition to installing the packages from REQUIREMENTS.txt, you should also get a Google API key for a project that has access both to the Directions and Geocoding API. We will use these to get the actual schedules and to determine which municipality the stops are located in. Visit this page and read the documentation to get started.

Usage

You should first set your Google API key in the envirorment (for example, in Terminal on a Mac, you could do this by export GOOGLE_API_KEY="MY_API_KEY") before launching the notebook server. The notebook is commented and self contained so you can just run the whole thing.

The notebook will generate a timetable like the one shown below and save it in timetable.html.

Sample timetable

The meaning of the specific data fields should be easy to understand; in case of unclarity they can be inferred from the code.

Contributing

Feel free to submit pull requests; help would be especially appreciated in turning this into a proper Python package and command line tool.

Roadmap

Ideally, I would like to create a CLI tool that is submitted to PIP and generates the timetable in one line. For example, it could be used as

transit_timetable \
	-o "Budapest, Hungary" \
	-d "Balatonhenye, Hungary" \
	-t 2018-10-20 \
	-k GOOGLE_API_KEY \
	-O timetable.html

See also

This post on my blog describes the project with a bit more context.

You can’t perform that action at this time.