Skip to content

A simple script that adds your train tickets booked on 12306.cn to Google Calendar

Notifications You must be signed in to change notification settings

w1ndy/12306.cal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

12306.cal

A simple script that adds your train tickets booked on 12306.cn to Google Calendar

A user script version is available at here.

Usage

  1. Install the requirements (icalendar, pytz, requests) with pip3 install -r requirements.txt
  2. Run with python3 12306cal.py begin_station end_station yyyy-mm-dd train_id.
Usage: 12306cal.py [options] begin_station end_station yyyy-mm-dd train_id

Options:
  -h, --help            show this help message and exit
  -s SEAT, --seat=SEAT  specify the booked seat which will be displayed as '@
                        SEAT' after the title of an event
  -x, --no-browser      do not open the browser automatically
  -o FILE, --ical=FILE  write to an ical file

Examples

python3 12306cal.py bjn shhq 2019-05-01 G1 -s 08-08A
python3 12306cal.py bjn shhq 2019-05-01 G1 -s 08-08A -o G1.ics

Licensed under Anti 996. Copyright (c) 2019 Project Contributors.

About

A simple script that adds your train tickets booked on 12306.cn to Google Calendar

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published