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
🛡️ 类型安全 全面使用 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 参数可选,不传则默认查询当前学期。

📂 项目结构

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.0.0.tar.gz (31.9 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.0.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecjtu_wechat_api-1.0.0.tar.gz
  • Upload date:
  • Size: 31.9 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.0.0.tar.gz
Algorithm Hash digest
SHA256 cc31b427aaafe9072de2a450d10a0b42d2b5009c09197fbb21209d2f93831ef3
MD5 3aea725065ee9d61878d0fb53dcbc542
BLAKE2b-256 4c96d5f189f7842f6bd8132a4c32895083d3036f5e28e4713bf53d8ca45b219a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ecjtu_wechat_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbbd56df32a95ab8b13920829764b9474f63a261dee9926eb5bf10efe0cd0357
MD5 2cad83e294e41158d38167c8d3ab4185
BLAKE2b-256 cdc9ae2317fe6f21fb8ec43cf5bd1ea72175bee94bde968b5043ff97f59fbc2e

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