Coder Social home page Coder Social logo

python_12306's Introduction

Python 12306 抢票小工具

12306用python实现的12306抢票小工具

对比另外的两个python项目自己封装了一些数据结构, 添加了自己觉得比较方便的逻辑

具体的更新日志请参考Changelog

如果有bug欢迎来提issue, 也欢迎开发者PR

2019.1.14 更新了日期查询为多日期, 需要修改对应的配置项为列表

2019.1.14 完成了打包功能, 使用说明参考下文

使用命令 pip install git+https://github.com/versionzhang/python_12306@master
即可安装此项目,项目会生成py12306的命令
在你需要运行的文件夹内创建config.yaml,编辑好配置文件即可使用

python版本支持

3.5以上

Features

  • 多日期查询余票
  • 自动打码下单
  • 用户状态自动检查
  • 下单成功邮件通知
  • 小黑屋策略
  • 预售模式
  • 两套下单接口(稳妥起见请选用正常下单流程, 因为是官网web端现在使用的接口)
  • 打包项目

TODO List

  • CDN加速
  • 代理(待定)
  • web管理后台自动生成项目配置

Usage

clone项目

适合查看代码并开发

  1. git clone https://github.com/versionzhang/python_12306.git克隆项目
  2. 进入python_12306目录, 安装依赖库, pip install -r requirement.txt
  3. 修改config.yaml_exmpale为config.yaml, 按照说明修改配置文件
  4. 安装好依赖之后, 运行python mainloop.py来进行抢票

使用pip安装项目

适合开箱即用

  1. 使用命令 pip install git+https://github.com/versionzhang/python_12306@dev 即可安装此项目,项目会生成py12306的命令
  2. 在你需要运行的文件夹内创建config.yaml,编辑好配置文件即可使用 py12306 运行程序

Notice

  1. 按照yaml的语法修改配置文件
  2. 乘车日期已经为多日期, 需要修改对应配置项为列表
  3. 现在clone项目之后的直接在项目的根目录下运行mainloop.py文件即可

Repo Status

项目还在开发中,目前正常下单流程已经可以跑通, 如果整个流程有什么大的问题欢迎提issue

目前有两种下单模式, 正常下单和快速下单, 快速下单模式有些车次日期会出票失败, 有些则不会. 稳妥起见请使用正常下单模式

Thanks

  1. 感谢EasyTrain仓库的创建者Why8n的详细过程分析, 正常下单流程逻辑参考仓库的源代码
  2. 感谢testerSunshine 12306仓库的创建者testerSunshine, 参考了仓库的配置文件,以及快速下单的模块接口实现

python_12306's People

Contributors

songroger avatar versionzhang 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.