Skip to main content

📚 sjtu-thesis

上海交大学位论文 → 离线 PDF,一条命令

扫码登录一次 · 检索 · 批量下载 · 本地建库

Stars Python Platform Network Use


✨ 它解决什么

站点的问题 这里的做法
加载慢、翻页痛苦 一次检索批量采元数据,一次下载整篇 PDF
不能离线、手机难读 产出标准 PDF,任何阅读器都能看
缺页、超时、断了不知道 每页校验,缺页列号,可断点续传
会话过期后整批静默失败 自动静默刷新一次,失败给可执行提示

🚀 快速开始

git clone https://github.com/MaybeBio/sjtu-thesis && cd sjtu-thesis
uv venv .venv && uv pip install -e .
.venv/bin/python -m playwright install chromium   # 仅登录需要
source .venv/bin/activate                          # 之后直接用 sjtu-thesis

想装成全局命令:pipx install .(之后用 pipx 环境里的 python 执行上面那行 playwright 安装)。

sjtu-thesis login                      # ① 手机扫码(交我办 / 微信),只需一次
sjtu-thesis search "量子纠缠" --by title --save   # ② 检索并入本地库
sjtu-thesis download 160315            # ③ 下载、合成 PDF 到 ./theses

🧰 命令速查

命令 用途
login 扫码登录;会话存 ~/.config/sjtu-thesis/session.json(0600,不存密码)
doctor 四项自检:代理 / 主站 / 会话 / 正文图片
search 按主题、题名、关键词、作者、院系、专业、导师、年份检索;--json --csv --save
info 单篇元数据与摘要
download download <paperid> 或 --title "完整题名";--jobs 并发,--force 重下
batch harvest 采元数据、download 按队列下载、retry 失败重入队
lib search / list / stats / verify / export --format csv / json / bibtex
sjtu-thesis batch harvest "机器学习" --max-pages 5   # 默认只抓第 1 页,--all 才全量
sjtu-thesis batch download --jobs 2
sjtu-thesis lib verify                               # 校验文件、sha256、页数、缺页

题名匹配是规范化后精确匹配;命中多篇会列出候选并退出(码 2),绝不替你挑。缺页默认不生成 PDF(码 1,列出缺页号),需要带占位页的版本才加 --allow-placeholders。

❓ 常见问题

提示「不能打开」,或 doctor 的 image 项失败

正文图片只对校内网络出口提供。连校园 VPN/代理,并确认它对命令行生效(echo $https_proxy)。工具会识别这种 82 字节的假页面直接报错,不会当成图片损坏反复重试。

提示需要重新登录(退出码 3)

会话过期。先直接重跑命令——工具会用已存 cookie 静默刷新一次;仍失败再 sjtu-thesis login。

某篇论文缺页

页面图片由服务端异步生成,通常 20 秒内齐全。工具会自动轮询;超时后列出缺页号并记为 failed,稍后 batch retry 一般能补齐。长期缺页多半是源 PDF 本身有问题。

「论文保密」怎么办

这类论文没有正文入口。工具记为 embargoed,批量时计数但不算失败。

退出码含义

0 成功 · 1 一般失败 · 2 题名歧义 · 3 需要登录 · 4 需要校内网络

🛠 开发

uv venv .venv && uv pip install -e ".[dev]"
.venv/bin/pytest -q                            # 离线单测
SJTU_LIVE=1 .venv/bin/pytest -m live -v        # 需会话 + 校内网
.venv/bin/ruff check . && .venv/bin/mypy sjtu_thesis

📌 后续

  • PDF → Markdown:这些 PDF 是纯图片、没有文字层,需 OCR 与版面还原
  • 局域网阅读器 / OPDS:手机平板直接浏览本地库

声明

仅供个人学习研究,下载内容受版权保护,请勿传播或公开分享。保密论文不提供正文,工具如实记录并跳过。

Metadata

Release files for sjtu-thesis 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sjtu-thesis 0.1.0
File Size Uploaded Provenance Actions
sjtu_thesis-0.1.0.tar.gz 40.8 kB Without provenance Details for sjtu_thesis-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sjtu-thesis 0.1.0
File Interpreter ABI Platform Actions
sjtu_thesis-0.1.0-py3-none-any.whl Python 3 none any Details for sjtu_thesis-0.1.0-py3-none-any.whl

Total release size: 89.5 kB

Release files / sjtu_thesis-0.1.0.tar.gz

Download URL sjtu_thesis-0.1.0.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2e0c242180eb7a3787ed72cedef56ec5985d370b9fb3196849d5e69afafa0589
BLAKE2b-256 checksum
How to use checksums
f8c75a08a500968551d8bdef2682d9e6af59d68807c3444d1a4c6105b8a385e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / sjtu_thesis-0.1.0-py3-none-any.whl

Download URL sjtu_thesis-0.1.0-py3-none-any.whl
Size 48.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ac628c18f9629b52c7b4e45d19370e625cf169acb29172e8182956a9df7883f
BLAKE2b-256 checksum
How to use checksums
4cea0a66bd0ab6d23fe3fd600d34cb8262d617f9c8199d08fea870fb8aced8d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for sjtu-thesis 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page