fundrive-pan115
115 网盘 Python API 封装(fundrives.pan115),从上游 p115client(0.0.9.6.5.1)完整迁入并自主维护,供 fundrive 及其他项目以统一命名空间稳定接入 115 网盘,避免受上游高频破坏性变更影响。
安装
本项目要求 Python 3.12 或更高版本。
pip install fundrive-pan115
# 或
uv add fundrive-pan115
快速开始
from pathlib import Path
from fundrives.pan115 import P115Client
# 方式一:使用 Cookie 字符串
client = P115Client(cookies="UID=...; CID=...; SEID=...; KID=...")
# 方式二:使用 Cookie 文件并支持扫码/续期
client = P115Client(Path("~/115-cookies.txt").expanduser(), app="qandroid")
client.login()
# 列出根目录文件
resp = client.fs_files(0)
print(resp)
开发
安装开发依赖并运行检查与测试:
uv sync --group dev
uv run ruff check src tests
uv run ruff format --check src tests
uv run pytest -v
构建发行包:
uv build
演进路线
- 阶段 0(已完成):完整迁入
p115client 0.0.9.6.5.1至fundrives.pan115命名空间,保持 API 100% 兼容,隔离上游高频改动。 - 阶段 1 & 2(已完成):移除未使用的
python-encode_uri,将全部 35 个上游微包内联至fundrives.pan115._vendor/,并用标准httpx替换urllib3-future避免劫持标准urllib3,实现 0 个上游作者微包依赖。 - 阶段 3(已完成):为
wcwidth、sqlparse、zstandard/brotli提供标准库回落与可选化,直接依赖进一步收敛至 6 个核心主流包(filelock、httpx、orjson、pycryptodome、qrcode、yarl);消除全局warnings.formatwarning污染与 Python 3.14SyntaxWarning;大幅收紧per-file-ignores并补齐P115Client协议级单测。 - 阶段 4(持续瘦身):移除
_vendor/中 27 / 35 个上游作者微包与冗余纯 Python AES 回落(净削减 ~11,700 行代码),将实际使用到的最小工具子集重写并归并为 8 个严格通过 Ruff 基线的自主内部模块(_utils.py、_path.py、_hash.py、_sqlite.py、_http.py、_request.py、_iterdir.py、_download.py),_vendor/仅余 3 个 115 协议模块与 5 个流式/并发核心层。
命名空间说明
本包与 fundrive-alipan、fundrive-baidu、fundrive-lanzou、fundrive-quark 共用 PEP 420 隐式命名空间包 fundrives,不得在 src/fundrives/ 下添加 __init__.py。
来源说明与第三方协议
src/fundrives/pan115/ 源码派生自 p115client(版本 0.0.9.6.5.1),原始协议为 MIT,Copyright (c) 2024 ChenyangGao。完整声明见 THIRD_PARTY_NOTICE.md。
关于 farfarfun-drive
farfarfun 的网盘 / 云存储产品线:以
fundrive 的统一 BaseDrive 接口为核心,
配套各网盘的独立驱动包与蓝奏云 SDK / 桌面客户端。
- 🏠 组织主页:https://github.com/farfarfun-drive
- 📦 PyPI:https://pypi.org/user/niuliangtao/
- 📧 联系:farfarfun@qq.com
本项目基于 MIT 协议开源。
Metadata
Release files for fundrive-pan115 2.0.104
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fundrive_pan115-2.0.104-py3-none-any.whl | Python 3 | none | any | Details for fundrive_pan115-2.0.104-py3-none-any.whl |
Release files / fundrive_pan115-2.0.104-py3-none-any.whl
| Download URL | fundrive_pan115-2.0.104-py3-none-any.whl |
|---|---|
| Size | 387.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a30fe118860002a9872394e877f3479171b8348a521917eac5e238a38c6377b
|
|
BLAKE2b-256 checksum How to use checksums |
e17c0396068336d306f7acaea6820fd023dd0caecf13c786f279d5e431fce0cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for fundrive-pan115 2.0.104
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.