Skip to content

tju

Python client for Tianjin University's SSO and EAMS systems.

PyPI version CI License: GPL v3

Beta. The API is functional; minor breaking changes may occur before v1.0.

tju is a Python library that logs into TJU's SSO and EAMS systems and returns structured academic data. It handles CAS authentication, CAPTCHA solving (via ddddocr), and HTML parsing — so your code just calls methods and gets typed objects back.

Network requirement: All live API calls require an active connection to the TJU campus network or VPN (sso.tju.edu.cn / classes.tju.edu.cn).

Features

Feature Client method
Student profile client.profile
Personal timetable client.schedule(semester)
Public course library client.query_courses(semester)
Course detail client.query_course_info(lession_id)
Course syllabus client.query_syllabus(lession_id)
Exam schedule client.exam(semester)
Scores (UG + GS) client.score()
Experiment scores client.exp_score(semester)
Free classroom search client.free_classrooms(date_begin, ...)

Installation

pip install tju                # Python library only
pip install 'tju[tui]'        # + interactive terminal app  (tju command)
pip install 'tju[mcp]'        # + local MCP server          (tju-mcp command)

Quick start

Terminal app:

tju          # full-screen interactive TUI — browse profile, schedule, scores, and more

MCP server (AI agent integration):

tju-mcp setup   # store credentials in OS keyring once
tju-mcp         # start the stdio MCP server

Add { "mcpServers": { "tju": { "command": "tju-mcp" } } } to Claude Desktop. Your password is never exposed to the agent — the server acts as the credential boundary.

Python API:

from tju.client import create_client

client = create_client()   # reads TJU_USER / TJU_PASS from env
print(client.profile)
print(client.schedule())

See the Quick Start page for full details, the TUI and MCP Server pages for the interactive interfaces, and the Examples page for runnable scripts.

License

GPLv3 © 2023-PRESENT Super Lee