pguangya 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pguangya-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: pguangya
3
+ Version: 0.1.0
4
+ Summary: Sync-first Python client for Guangya cloud drive Web APIs.
5
+ Author: KC
6
+ License-Expression: MIT
7
+ Keywords: guangya,cloud-drive,sync,filesystem
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Topic :: Internet :: WWW/HTTP
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.11
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: httpx<1,>=0.27
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest<9,>=8; extra == "dev"
21
+ Requires-Dist: mypy<2,>=1.11; extra == "dev"
22
+ Requires-Dist: build<2,>=1.2; extra == "dev"
23
+ Requires-Dist: twine<7,>=5; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ # pguangya
27
+
28
+ `pguangya` 是面向项目直接集成的光鸭云盘同步 Python 客户端。
29
+
30
+ 它复用光鸭 Windows PC Web 协议,提供纯同步 Python API。项目覆盖账号、
31
+ 文件、资产、下载、分享、离线任务和上传主链路;不包含官方开发者
32
+ `dapi.guangyapan.com` OpenAPI、本地 Web 服务、WebDAV 或 HDHive 集成。
33
+
34
+ > 本项目不是光鸭官方 SDK。逆向协议可能随上游版本变化。请仅在获准账号和
35
+ > 数据范围内使用,并自行遵守服务条款与适用法律。
36
+
37
+ ## 特性
38
+
39
+ - `PGuangyaClient`:全部已确认的非 Open Web 端点
40
+ - `PGuangyaFileSystem`:ID/路径查询、遍历及文件操作
41
+ - `GuangyaLogin`:扫码、短信登录及会话刷新
42
+ - `PGuangyaHelper`:下载、打包、分享和离线任务工作流
43
+ - `PGuangyaUploadHelper`:GCID 秒传、OSS 单 PUT、multipart 和断点续传
44
+ - 完整响应 envelope 保留,未知字段不丢失
45
+ - 纯同步调用,无 CLI、Web 服务或异步双栈
46
+
47
+ ## 安装
48
+
49
+ ```bash
50
+ pip install pguangya
51
+ ```
52
+
53
+ 本地开发:
54
+
55
+ ```bash
56
+ pip install -e ".[dev]"
57
+ pytest
58
+ ```
59
+
60
+ ## 快速开始
61
+
62
+ ```python
63
+ from pguangya import GuangyaSession, PGuangyaClient, PGuangyaFileSystem
64
+
65
+ session = GuangyaSession(
66
+ access_token="...",
67
+ refresh_token="...",
68
+ device_id="0123456789abcdef0123456789abcdef",
69
+ )
70
+
71
+ with PGuangyaClient(session=session) as client:
72
+ fs = PGuangyaFileSystem(client)
73
+ for item in fs.iter_entries("/"):
74
+ print(item)
75
+ ```
76
+
77
+ 登录所得 `access_token`、`refresh_token` 和稳定 `device_id` 只保存在内存中。
78
+ 调用方可通过会话导出接口自行持久化;库不会默认写入磁盘。
79
+
80
+ ## 安全边界
81
+
82
+ - PC OAuth 默认画像可由构造参数或环境变量覆盖。
83
+ - OAuth secret、Bearer token、refresh token 和 OSS STS 不进入日志或异常文本。
84
+ - 鉴权失效只刷新并重放一次,不作无界重试。
85
+ - 删除、清空回收站、取消分享等方法不会弹出交互确认。
86
+ - 上传 checkpoint 不保存任何临时密钥。
87
+ - live smoke 仅用于显式、只读验证,不属于默认测试。
88
+
89
+ ## 状态
90
+
91
+ 当前版本为 `0.1.0`。API 仍处 Alpha 阶段。
92
+
93
+ 发布前执行模拟协议测试、类型检查与安装包检查。短信登录进入网页验证后可继续原登录,
94
+ 不会重复校验已消费的短信验证码。尚未完成真实账号的登录、转存及上传全流程验证。
@@ -0,0 +1,69 @@
1
+ # pguangya
2
+
3
+ `pguangya` 是面向项目直接集成的光鸭云盘同步 Python 客户端。
4
+
5
+ 它复用光鸭 Windows PC Web 协议,提供纯同步 Python API。项目覆盖账号、
6
+ 文件、资产、下载、分享、离线任务和上传主链路;不包含官方开发者
7
+ `dapi.guangyapan.com` OpenAPI、本地 Web 服务、WebDAV 或 HDHive 集成。
8
+
9
+ > 本项目不是光鸭官方 SDK。逆向协议可能随上游版本变化。请仅在获准账号和
10
+ > 数据范围内使用,并自行遵守服务条款与适用法律。
11
+
12
+ ## 特性
13
+
14
+ - `PGuangyaClient`:全部已确认的非 Open Web 端点
15
+ - `PGuangyaFileSystem`:ID/路径查询、遍历及文件操作
16
+ - `GuangyaLogin`:扫码、短信登录及会话刷新
17
+ - `PGuangyaHelper`:下载、打包、分享和离线任务工作流
18
+ - `PGuangyaUploadHelper`:GCID 秒传、OSS 单 PUT、multipart 和断点续传
19
+ - 完整响应 envelope 保留,未知字段不丢失
20
+ - 纯同步调用,无 CLI、Web 服务或异步双栈
21
+
22
+ ## 安装
23
+
24
+ ```bash
25
+ pip install pguangya
26
+ ```
27
+
28
+ 本地开发:
29
+
30
+ ```bash
31
+ pip install -e ".[dev]"
32
+ pytest
33
+ ```
34
+
35
+ ## 快速开始
36
+
37
+ ```python
38
+ from pguangya import GuangyaSession, PGuangyaClient, PGuangyaFileSystem
39
+
40
+ session = GuangyaSession(
41
+ access_token="...",
42
+ refresh_token="...",
43
+ device_id="0123456789abcdef0123456789abcdef",
44
+ )
45
+
46
+ with PGuangyaClient(session=session) as client:
47
+ fs = PGuangyaFileSystem(client)
48
+ for item in fs.iter_entries("/"):
49
+ print(item)
50
+ ```
51
+
52
+ 登录所得 `access_token`、`refresh_token` 和稳定 `device_id` 只保存在内存中。
53
+ 调用方可通过会话导出接口自行持久化;库不会默认写入磁盘。
54
+
55
+ ## 安全边界
56
+
57
+ - PC OAuth 默认画像可由构造参数或环境变量覆盖。
58
+ - OAuth secret、Bearer token、refresh token 和 OSS STS 不进入日志或异常文本。
59
+ - 鉴权失效只刷新并重放一次,不作无界重试。
60
+ - 删除、清空回收站、取消分享等方法不会弹出交互确认。
61
+ - 上传 checkpoint 不保存任何临时密钥。
62
+ - live smoke 仅用于显式、只读验证,不属于默认测试。
63
+
64
+ ## 状态
65
+
66
+ 当前版本为 `0.1.0`。API 仍处 Alpha 阶段。
67
+
68
+ 发布前执行模拟协议测试、类型检查与安装包检查。短信登录进入网页验证后可继续原登录,
69
+ 不会重复校验已消费的短信验证码。尚未完成真实账号的登录、转存及上传全流程验证。
@@ -0,0 +1,43 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pguangya"
7
+ version = "0.1.0"
8
+ description = "Sync-first Python client for Guangya cloud drive Web APIs."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "KC" }]
14
+ keywords = ["guangya", "cloud-drive", "sync", "filesystem"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Topic :: Internet :: WWW/HTTP",
22
+ "Topic :: Software Development :: Libraries :: Python Modules",
23
+ ]
24
+ dependencies = ["httpx>=0.27,<1"]
25
+
26
+ [project.optional-dependencies]
27
+ dev = ["pytest>=8,<9", "mypy>=1.11,<2", "build>=1.2,<2", "twine>=5,<7"]
28
+
29
+ [tool.setuptools]
30
+ package-dir = { "" = "src" }
31
+
32
+ [tool.setuptools.package-data]
33
+ pguangya = ["py.typed"]
34
+
35
+ [tool.setuptools.packages.find]
36
+ where = ["src"]
37
+ include = ["pguangya", "pguangya.*"]
38
+ namespaces = false
39
+
40
+ [tool.pytest.ini_options]
41
+ addopts = "--import-mode=importlib"
42
+ python_files = ["*_test.py"]
43
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,22 @@
1
+ from .client import GuangyaSession, PGuangyaClient
2
+ from .filesystem import PGuangyaFileSystem
3
+ from .helpers import PGuangyaHelper
4
+ from .login import GuangyaLogin
5
+ from .oss_upload import OssError, OssUploader, choose_part_size, upload_file_to_oss
6
+ from .upload import PGuangyaUploadHelper, UploadError
7
+ from .version import __version__
8
+
9
+ __all__ = [
10
+ "GuangyaLogin",
11
+ "GuangyaSession",
12
+ "OssError",
13
+ "OssUploader",
14
+ "PGuangyaClient",
15
+ "PGuangyaFileSystem",
16
+ "PGuangyaHelper",
17
+ "PGuangyaUploadHelper",
18
+ "UploadError",
19
+ "__version__",
20
+ "choose_part_size",
21
+ "upload_file_to_oss",
22
+ ]