Skip to main content

Train tickets query via command line.

Project description

tickets enable you query variable tickets via command line, type:

$ tickets 上海虹桥 北京 20160617

in command line, get train tickets from 上海虹桥 to 北京 in 2016-06-17:

besides, you can specify train type:

$ tickets -g 上海 北京 20160617

Only query high-seed rail.

For show query, type:

$ tickets 南京 音乐会

you will get concerts in Nanjin city within 15 days:

You can specify within how many days, like:

$ tickets 上海 演唱会 7

to query 7 days in the future.


$ pip3 install tickets


$ git clone

then go to tickets dir,

$ ./ install


    tickets [-dgktz] <from> <to> <date>
    tickets <city> <show> [<days>]

    from             出发站
    to               到达站
    date             查询日期

    city             查询城市
    show             演出的类型
    days             查询近(几)天内的演出, 若省略, 默认15

    -h, --help       显示该帮助菜单.
    -d               动车
    -g               高铁
    -k               快速
    -t               特快
    -z               直达

    演唱会 音乐会 比赛 话剧 歌剧 舞蹈 戏曲 相声 音乐剧 歌舞剧 儿童剧 杂技 马戏 魔术

    tickets 南京 北京 201671
    tickets -k  南京南 上海 2016-7-1
    tickets -dg 上海虹桥 北京西 2016/7/1

    tickets 上海 演唱会
    tickets 北京 比赛 7


  • In consideration of tickets is just a tool, not lib, so not much necessary to suport Pyhton2 anymore.
  • Train query date surport max 50 days offset today, less or more will be considered as a invalid date.
  • If you don’t use delimiter, make sure your date is not ambiguous. e.g. By 2016115 you mean 2016-1-15 or 2016-11-5 ? By default, it parsed to 2016-11-5.


  • 修正Windows下面的编码问题
  • 修正查询show时不支持城市报错问题


  • 不再使用colorama
  • 改变显示演出的方式


  • 小bug修复


  • setup缺失colorama修复


  • 不再支持Python2
  • 重构了代码
  • 增加的查询演出门票的功能


  • use unicode global
  • add a logo


  • Make it live!
  • Added to PyPI

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tickets, version 0.2.4
Filename, size File type Python version Upload date Hashes
Filename, size tickets-0.2.4-py3-none-any.whl (29.9 kB) File type Wheel Python version 3.4 Upload date Hashes View
Filename, size tickets-0.2.4.tar.gz (28.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page