✨ 它解决什么
| 站点的问题 | 这里的做法 |
|---|---|
| 加载慢、翻页痛苦 | 一次检索批量采元数据,一次下载整篇 PDF |
| 不能离线、手机难读 | 产出标准 PDF,任何阅读器都能看 |
| 缺页、超时、断了不知道 | 每页校验,缺页列号,可断点续传 |
| 会话过期后整批静默失败 | 自动静默刷新一次,失败给可执行提示 |
🚀 快速开始
安装(任选其一,包都一样)
pipx install sjtu-thesis # 推荐:独立环境,命令直接可用
uv tool install sjtu-thesis # 等价,uv 用户首选
pip install sjtu-thesis # 已习惯 pip 时
uvx playwright install chromium # 首次使用前跑一次(浏览器不在包里,约 130 MB)
sjtu-thesis login # ① 手机扫码(交我办 / 微信),只需一次
sjtu-thesis search "量子纠缠" --by title --save # ② 检索并入本地库
sjtu-thesis download 160315 # ③ 下载、合成 PDF 到 ./theses
从源码安装(开发或需要最新代码)
git clone https://github.com/MaybeBio/sjtu-thesis && cd sjtu-thesis
pip install -e ".[dev]" # 装进当前 Python 环境,建议先激活虚拟环境
playwright install chromium
🧰 命令速查
完整参数与示例见 USAGE.md。
| 命令 | 用途 |
|---|---|
login |
扫码登录;会话存 ~/.config/sjtu-thesis/session.json(0600,不存密码) |
doctor |
四项自检:代理 / 主站 / 会话 / 正文图片 |
search |
按主题、题名、关键词、作者、院系、专业、导师、年份检索;--json --csv --save --wide |
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 需要校内网络
🛠 开发
pip install -e ".[dev]"
pytest -q # 离线单测
SJTU_LIVE=1 pytest -m live -v # 需会话 + 校内网
ruff check . && mypy sjtu_thesis
📦 发布
uv build # 构建 wheel + sdist
uvx twine check dist/* # 校验 README 在 PyPI 的渲染
uvx twine upload dist/* # 正式发布
📌 后续
- PDF → Markdown:这些 PDF 是纯图片、没有文字层,需 OCR 与版面还原
- 局域网阅读器 / OPDS:手机平板直接浏览本地库
声明
仅供个人学习研究,下载内容受版权保护,请勿传播或公开分享。保密论文不提供正文,工具如实记录并跳过。
Metadata
Release files for sjtu-thesis 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sjtu_thesis-0.1.1.tar.gz | 42.3 kB | Without provenance | Details for sjtu_thesis-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sjtu_thesis-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for sjtu_thesis-0.1.1-py3-none-any.whl |
Total release size: 92.3 kB
Release files / sjtu_thesis-0.1.1.tar.gz
| Download URL | sjtu_thesis-0.1.1.tar.gz |
|---|---|
| Size | 42.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f4e13edc613f517112929915f166e60f6686272b23ff9c2cf299cac269d8122
|
|
BLAKE2b-256 checksum How to use checksums |
a3f4a308daae20896576cf9de44bbf365045717b0a51121c5aa3e5c2e459ae72
|
| 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.1-py3-none-any.whl
| Download URL | sjtu_thesis-0.1.1-py3-none-any.whl |
|---|---|
| Size | 50.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71c4930b51e6cb9f11adb922e289e84e1c64ecce14e724bcc6c140bc3b294b43
|
|
BLAKE2b-256 checksum How to use checksums |
b6b1b9bbef6ae8f586f13024b58ad62b88573f679595d8b7a677f878e3140be9
|
| 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.1
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.