GithubHelp home page GithubHelp logo

peng1999 / nwpu-grade Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 0.0 214 KB

大学期末成绩查询和Telegram Bot,支持多个学校

License: GNU General Public License v3.0

Python 98.09% Dockerfile 1.91%
nwpu telegram-bot buaa

nwpu-grade's Introduction

NWPUgrade

大学成绩查询/通知 Telegram Bot(现支持西工大和北航)

想要支持更多学校?

简介

  • 再也无需不厌其烦地登陆教务系统查看成绩

    • 按学期/学年计算学分绩
    • 查看分数构成(平时成绩,实验成绩,卷面成绩)
  • 每次新成绩出炉都会有Telegram消息推送

环境

本项目需要运行在 Python 3.6 及更高的版本上。 同时需要系统环境具有 sqlite3。

Python 包依赖:

  • requests
  • lxml
  • cssselect
  • python-telegram-bot
  • pydantic
  • peewee

部署 Telegram Bot

普通方式

  1. 克隆项目

    git clone https://github.com/peng1999/nwpu-grade.git
    
  2. 安装 Poetry

    python3 -m pip install --user poetry
    
  3. 利用 Poetry 安装 Python 环境

    poetry install
    
  4. 利用 Bot Father 创建一个 Telegram Bot。

  5. 创建并修改 config.py

    cp config.py.example config.py
    vim config.py
    
  6. 运行

    poetry run python launch_bot.py
    

注:

  1. Telegram 无法在**大陆正常访问,你可能需要配置代理。
  2. Poetry 的其他安装方式见官网
  3. Poetry 不是必须的,也可以直接使用 pip 安装依赖包

Docker 部署

  1. 克隆项目

    git clone https://github.com/peng1999/nwpu-grade.git
    
  2. 利用 Bot Father 创建一个 Telegram Bot。

  3. 创建并修改 config.py

    cp config.py.example config.py
    vim config.py
    
  4. 构建并运行 Docker

    docker build -t nwpu-grade .
    docker run -d -e HTTPS_PROXY=<your proxy address> --name nwpu-grade nwpu-grade
    

多学校支持

欢迎提交 PR!

若要增加更多学校,只需在 scrapers 文件夹下面新增一个文件,实现继承于 ConfigBaseConfig 类和继承于 ScraperBase 类的 Scraper 类即可。请参照 scrapers.nwpu 编写。

测试脚本 client.py

本项目附带一个 client.py 方便 Scraper 的测试开发,使用 client.py 之前需要先在 config.py 中添加 get_scraper 函数。

python3 client.py

致谢

本项目受到了 @Dy1aNT 已经停止更新的项目 https://github.com/Dy1aNT/NWPUgrade.git 的启发。

nwpu-grade's People

Contributors

dy1ant avatar peng1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nwpu-grade's Issues

dockerfile

dockerfile中运行python代码应该为poetry run python3 launch_bot.py

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.