Skip to main content

华东交通大学教务系统微信版 API

Project description

🏫 ECJTU WeChat API

华东交通大学教务系统微信版 API

Python Version FastAPI uv License

核心功能技术栈快速开始API 文档贡献指南


📖 项目简介

ECJTU WeChat API 是一个非官方的教务系统数据接口服务。通过抓包与逆向工程分析华东交通大学教务系统在微信公众号的接口,我们将其封装为现代化、类型安全且易于使用的 RESTful API。

该项目旨在为校园开发者提供稳定可靠的数据接入方案,支持课程表查询成绩获取考试安排查询等核心教务功能,并提供结构化的 JSON 数据响应,彻底告别繁琐的 HTML 解析。

✨ 核心功能

功能 描述 API 路径
📅 每日课表 获取指定日期的详细课程安排,支持自动解析课程节点、教室及教师信息。 GET /courses/daily
📊 成绩查询 获取指定学期的成绩数据(默认为当前学期),包含所有可选学期列表、原始分数、学分、绩点及补考状态。 GET /scores/info
📝 考试安排 获取指定学期的考试安排(默认为当前学期),包含考试时间、地点、课程信息及所有可选学期列表。 GET /exams/schedule
🛡️ 类型安全 全面使用 Pydantic 模型定义数据结构,API 响应清晰、字段明确。 -
高性能 基于 FastAPI 构建,异步处理请求,响应速度极快。 -

🛠️ 技术栈

🚀 快速开始

1. 环境准备

本项目采用新一代 Python 包管理工具 uv。请先确保您的环境中已安装 uv:

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

2. 克隆与安装

# 克隆仓库
git clone https://github.com/mochenya/ecjtu-wechat-api
cd ecjtu-wechat-api

# 同步依赖 (uv 会自动创建并管理虚拟环境)
uv sync

3. 启动服务

# 开启开发服务器 (支持热重载)
uv run uvicorn ecjtu_wechat_api.main:app --host 0.0.0.0 --port 6894 --reload

服务启动成功后,终端将显示如下信息:

INFO:     Uvicorn running on http://0.0.0.0:6894 (Press CTRL+C to quit)

📖 API 文档

服务启动后,您可以通过浏览器访问交互式 API 文档,直接在线测试接口:

接口调用示例

获取当日课表

GET /courses/daily?weiXinID=微信教务公众号里的WEIXINID&date=2026-01-01

获取成绩信息

GET /scores/info?weiXinID=微信教务公众号里的WEIXINID&term=2025.1

term 参数可选,不传则默认查询当前学期。

获取考试安排

GET /exams/schedule?weiXinID=微信教务公众号里的WEIXINID&term=2025.1

term 参数可选,不传则默认查询当前学期。

📂 项目结构

ecjtu_wechat_api/
├── src/
│   └── ecjtu_wechat_api/
│       ├── api/            # 路由层:定义 API 接口       ├── core/           # 核心层:配置、异常处理       ├── models/         # 模型层:Pydantic 数据结构       ├── services/       # 服务层:业务逻辑与 HTML 解析       ├── utils/          # 工具层:辅助函数       └── main.py         # 应用入口
├── tests/                  # 测试套件
├── pyproject.toml          # 项目配置
├── uv.lock                 # 依赖锁定
└── build_and_install.sh    # 构建脚本

⚠️ 免责声明

本项目仅供编程学习与技术研究使用。

  1. 开发者不对使用本 API 产生的任何后果负责。
  2. 请勿将本工具用于任何非法用途(如恶意爬虫、暴力破解等)。
  3. 请遵守学校网络管理规定,合理使用校园网资源。

Made with ❤️ by mochenyaa

Project details


Download files

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

Source Distribution

ecjtu_wechat_api-1.1.0.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecjtu_wechat_api-1.1.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file ecjtu_wechat_api-1.1.0.tar.gz.

File metadata

  • Download URL: ecjtu_wechat_api-1.1.0.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for ecjtu_wechat_api-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c3274c191cac8e8909e277e001fbdbe7dfd2460a8b70178582587e821bc830f4
MD5 8b003d27253b744fe222dbe7201a53ed
BLAKE2b-256 3221188b9ba51a90b995474256e584f1dc4382205bb522b88a70cd7ce0126128

See more details on using hashes here.

File details

Details for the file ecjtu_wechat_api-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ecjtu_wechat_api-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2e4807dec9ddcc564c429cbf67f0ca2deb7ba0e265da9272c1ccbdc6503bbba
MD5 4cec7cc3de3c7f198409f72e33bf51cd
BLAKE2b-256 0bb0825d6c90f309a243ab354ae7c0e87d10fc04919d1dc81c3b1f62918b3842

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page