Skip to main content

pguangya

pguangya 是面向项目直接集成的光鸭云盘同步 Python 客户端。

它复用光鸭 Windows PC Web 协议,提供纯同步 Python API。项目覆盖账号、 文件、资产、下载、分享、离线任务和上传主链路;不包含官方开发者 dapi.guangyapan.com OpenAPI、本地 Web 服务、WebDAV 或 HDHive 集成。

本项目不是光鸭官方 SDK。逆向协议可能随上游版本变化。请仅在获准账号和 数据范围内使用,并自行遵守服务条款与适用法律。

特性

  • PGuangyaClient:全部已确认的非 Open Web 端点
  • PGuangyaFileSystem:ID/路径查询、遍历及文件操作
  • GuangyaLogin:扫码、短信登录及会话刷新
  • PGuangyaHelper:下载、打包、分享和离线任务工作流
  • PGuangyaUploadHelper:GCID 秒传、OSS 单 PUT、multipart 和断点续传
  • 完整响应 envelope 保留,未知字段不丢失
  • 纯同步调用,无 CLI、Web 服务或异步双栈

安装

pip install pguangya

本地开发:

pip install -e ".[dev]"
pytest

快速开始

from pguangya import GuangyaSession, PGuangyaClient, PGuangyaFileSystem

session = GuangyaSession(
    access_token="...",
    refresh_token="...",
    device_id="0123456789abcdef0123456789abcdef",
)

with PGuangyaClient(session=session) as client:
    fs = PGuangyaFileSystem(client)
    for item in fs.iter_entries("/"):
        print(item)

登录所得 access_token、refresh_token 和稳定 device_id 只保存在内存中。 调用方可通过会话导出接口自行持久化;库不会默认写入磁盘。

安全边界

  • PC OAuth 默认画像可由构造参数或环境变量覆盖。
  • OAuth secret、Bearer token、refresh token 和 OSS STS 不进入日志或异常文本。
  • 鉴权失效只刷新并重放一次,不作无界重试。
  • 删除、清空回收站、取消分享等方法不会弹出交互确认。
  • 上传 checkpoint 不保存任何临时密钥。
  • live smoke 仅用于显式、只读验证,不属于默认测试。

状态

当前版本为 0.1.0。API 仍处 Alpha 阶段。

发布前执行模拟协议测试、类型检查与安装包检查。短信登录进入网页验证后可继续原登录, 不会重复校验已消费的短信验证码。尚未完成真实账号的登录、转存及上传全流程验证。

Metadata

Release files for pguangya 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 pguangya 0.1.0
File Size Uploaded Provenance Actions
pguangya-0.1.0.tar.gz 30.9 kB Without provenance Details for pguangya-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 64.3 kB

Release files / pguangya-0.1.0.tar.gz

Download URL pguangya-0.1.0.tar.gz
Size 30.9 kB
Tags Source
SHA-256 checksum
How to use checksums
18711b4d6f6ce91de9e8f092dc14a717ba7738dde8e45fc288cd19ccca7c4857
BLAKE2b-256 checksum
How to use checksums
d689d32531963fb771850b142e392448697112c306d2f7bc22b9e0759353a47e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

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

Download URL pguangya-0.1.0-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef4ce969cf20750684d109754a8f541e331cb61a14b87db4ee44ba3705aa5d43
BLAKE2b-256 checksum
How to use checksums
aec963053ed01d253eefe78f8dd55450fa1ca47748232f7991bb94e7049834c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for pguangya 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