fundrive-baidu
百度网盘(BaiduPCS)Python API 封装,提供文件列表/搜索、上传下载、移动复制、 离线下载、分享与转存等常用能力,供 fundrive 及其他项目以统一接口接入百度网盘。
安装
pip install fundrive-baidu
# 或
uv add fundrive-baidu
快速开始
请先通过环境变量提供凭据,避免把敏感信息写入源码或命令历史:
export BDUSS="从百度账号获取的 BDUSS"
export STOKEN="分享接口需要的 STOKEN"
客户端会自动读取 BDUSS、STOKEN 和可选的 PTOKEN;也可以在受信任的凭据管理器中读取后显式传入。
from fundrives.baidu import BaiduPCSApi
api = BaiduPCSApi()
# 列出网盘根目录文件
for pcs_file in api.list("/"):
print(pcs_file.path, pcs_file.is_dir, pcs_file.size)
主要能力
- 文件列表、元数据查询、搜索
- 上传(含分片上传、秒传)、下载链接与流式下载
- 移动、复制、重命名、删除、新建目录
- 离线下载任务(普通链接、磁力链接)
- 分享链接创建/查询/取消,以及分享内容转存
来源说明
本项目源码来自 PeterDing/BaiduPCS-Py (MIT 协议, Copyright (c) 2021 Peter Ding),在此基础上去除了命令行界面代码与部分服务端代码, 减少相关依赖,只保留可编程调用的 API 部分。
关于 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-baidu 2.0.99
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_baidu-2.0.99-py3-none-any.whl | Python 3 | none | any | Details for fundrive_baidu-2.0.99-py3-none-any.whl |
Release files / fundrive_baidu-2.0.99-py3-none-any.whl
| Download URL | fundrive_baidu-2.0.99-py3-none-any.whl |
|---|---|
| Size | 60.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0035a34c5a8251f58148c16daa9d28c818fa156d6cb9b3c8fbf1c1967b395b1
|
|
BLAKE2b-256 checksum How to use checksums |
266b8d9f2a23ecc6aa3a2399f5a38c6d4f20f37e1794ea5e8af2f8b4df770613
|
| 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-baidu 2.0.99
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.