Skip to main content

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

演进路线

  1. 阶段 0(已完成):完整迁入 p115client 0.0.9.6.5.1 至 fundrives.pan115 命名空间,保持 API 100% 兼容,隔离上游高频改动。
  2. 阶段 1 & 2(已完成):移除未使用的 python-encode_uri,将全部 35 个上游微包内联至 fundrives.pan115._vendor/,并用标准 httpx 替换 urllib3-future 避免劫持标准 urllib3,实现 0 个上游作者微包依赖。
  3. 阶段 3(已完成):为 wcwidth、sqlparse、zstandard/brotli 提供标准库回落与可选化,直接依赖进一步收敛至 6 个核心主流包(filelock、httpx、orjson、pycryptodome、qrcode、yarl);消除全局 warnings.formatwarning 污染与 Python 3.14 SyntaxWarning;大幅收紧 per-file-ignores 并补齐 P115Client 协议级单测。
  4. 阶段 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 / 桌面客户端。

本项目基于 MIT 协议开源。

Metadata

Release files for fundrive-pan115 2.0.103

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

Built distribution (wheel)

Table of built distributions (wheels) for fundrive-pan115 2.0.103
File Interpreter ABI Platform Actions
fundrive_pan115-2.0.103-py3-none-any.whl Python 3 none any Details for fundrive_pan115-2.0.103-py3-none-any.whl

Release files / fundrive_pan115-2.0.103-py3-none-any.whl

Download URL fundrive_pan115-2.0.103-py3-none-any.whl
Size 380.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2210558e452436522683b6265a3a2bd93f4019eae2aa4dd85eac8346791073ff
BLAKE2b-256 checksum
How to use checksums
55c4987c0a3d06011ca1a43394680a7501b768f126e1a40a074c43b27a55a373
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.103

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.

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