Analysis updated 2026-06-24
Automate snapping up scarce 12306 train tickets for holiday travel in China
Run multiple buying tasks across several accounts and dates in parallel
Set up a Redis-backed master-and-child cluster so booking continues if a node crashes
Receive ticket-found notifications by email, Telegram, WeChat, or voice phone call
| pjialin/py12306 | waditu/tushare | llmware-ai/llmware | |
|---|---|---|---|
| Stars | 14,896 | 14,878 | 14,860 |
| Language | Python | Python | Python |
| Last pushed | — | — | 2026-05-17 |
| Maintenance | — | — | Maintained |
| Setup difficulty | moderate | easy | moderate |
| Complexity | 3/5 | 2/5 | 4/5 |
| Audience | developer | data | developer |
Figures from each repo's GitHub metadata at analysis time.
Needs Python 3.6+, a working 12306 account, and the shared captcha service, distributed mode also needs Redis.
py12306 is a ticket-buying helper for 12306, the official online booking site for trains in mainland China. The project is written in Python and is aimed at people who want to grab tickets for popular routes where seats sell out quickly. According to the README, it lets you search for remaining tickets across multiple dates, log in with several accounts at once, run many buying tasks in parallel, and place orders automatically when a seat becomes available. The README lists the features the project supports today. Among them: automatic captcha solving, recovery of user login state, voice phone notifications, email notifications, WeChat push messages via DingTalk, Telegram, ServerChan, and PushBear, querying a single task across multiple stations, and a web management page for viewing users, tasks, and live logs. A proxy pool feature is listed as not yet done. The captcha service currently relies on a free shared platform run by the author. To use it you need Python 3.6 or newer. You clone the repo, install the dependencies from requirements.txt, copy env.py.example to env.py, edit the config, then run python main.py. A -t flag runs a configuration test, and -n adds a notification test. The project also supports running as a distributed cluster, where one master node and several child nodes share work through Redis. If the master crashes, a child node is promoted automatically. A Docker image and a docker-compose example are provided. The project is released under the Apache License.
py12306 is a Python tool that automates buying tickets on China Railway's 12306 site by searching across dates, logging in many accounts, and placing orders when seats appear.
Mainly Python. The stack also includes Python, Redis, Docker.
Apache 2.0: free to use, modify, and redistribute commercially, with a patent grant and attribution required.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.