cpan123 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.
Files changed (66) hide show
  1. cpan123-0.1.0/.gitignore +18 -0
  2. cpan123-0.1.0/.python-version +1 -0
  3. cpan123-0.1.0/.readthedocs.yaml +23 -0
  4. cpan123-0.1.0/CHANGELOG.md +4 -0
  5. cpan123-0.1.0/PKG-INFO +26 -0
  6. cpan123-0.1.0/README.md +7 -0
  7. cpan123-0.1.0/assets/00a7d3feb7.png +0 -0
  8. cpan123-0.1.0/assets/00aa60e133.png +0 -0
  9. cpan123-0.1.0/assets/00aeced0c2_/345/262/251/345/277/265/346/202/204/347/253/271/351/231/266.png +0 -0
  10. cpan123-0.1.0/assets/00be405234.png +0 -0
  11. cpan123-0.1.0/assets/00cc30f065_/344/273/260/345/211/212/345/217/246/346/211/256/346/235/240.png +0 -0
  12. cpan123-0.1.0/assets/00e2c1e3e1.png +0 -0
  13. cpan123-0.1.0/assets/00fbe6d10c_/345/206/260/345/220/247/347/217/215/347/217/255/350/212/246.png +0 -0
  14. cpan123-0.1.0/assets/0a19bbddea_/344/271/217/345/256/231/346/263/241/347/223/234/350/211/262.png +0 -0
  15. cpan123-0.1.0/assets/0a27b3979e.png +0 -0
  16. cpan123-0.1.0/assets/0a3a9a0fdb.png +0 -0
  17. cpan123-0.1.0/assets/0a73cca191_/345/215/227/345/215/240/345/273/272/347/213/240/350/242/215.png +0 -0
  18. cpan123-0.1.0/assets/0a75f78d9e_/344/272/256/345/205/203/345/221/250/346/202/243/350/204/226.png +0 -0
  19. cpan123-0.1.0/assets/a.webp +0 -0
  20. cpan123-0.1.0/assets/b.webp +0 -0
  21. cpan123-0.1.0/docs/auth.md +8 -0
  22. cpan123-0.1.0/docs/checkdata.md +9 -0
  23. cpan123-0.1.0/docs/directlink.md +5 -0
  24. cpan123-0.1.0/docs/file.md +3 -0
  25. cpan123-0.1.0/docs/images/cuttlefish.svg +1 -0
  26. cpan123-0.1.0/docs/index.md +120 -0
  27. cpan123-0.1.0/docs/interface.md +118 -0
  28. cpan123-0.1.0/docs/javascripts/mathjax.js +19 -0
  29. cpan123-0.1.0/docs/offline.md +5 -0
  30. cpan123-0.1.0/docs/oss.md +4 -0
  31. cpan123-0.1.0/docs/pan.md +3 -0
  32. cpan123-0.1.0/docs/requirements.txt +8 -0
  33. cpan123-0.1.0/docs/share.md +4 -0
  34. cpan123-0.1.0/docs/user.md +3 -0
  35. cpan123-0.1.0/mkdocs.yml +147 -0
  36. cpan123-0.1.0/pyproject.toml +54 -0
  37. cpan123-0.1.0/src/cpan123/__init__.py +3 -0
  38. cpan123-0.1.0/src/cpan123/apijson/__init__.py +0 -0
  39. cpan123-0.1.0/src/cpan123/apijson/directlink.json +80 -0
  40. cpan123-0.1.0/src/cpan123/apijson/file.json +364 -0
  41. cpan123-0.1.0/src/cpan123/apijson/offline.json +34 -0
  42. cpan123-0.1.0/src/cpan123/apijson/oss.json +331 -0
  43. cpan123-0.1.0/src/cpan123/apijson/share.json +101 -0
  44. cpan123-0.1.0/src/cpan123/apijson/user.json +38 -0
  45. cpan123-0.1.0/src/cpan123/directlink.py +70 -0
  46. cpan123-0.1.0/src/cpan123/file.py +306 -0
  47. cpan123-0.1.0/src/cpan123/offline.py +47 -0
  48. cpan123-0.1.0/src/cpan123/oss.py +239 -0
  49. cpan123-0.1.0/src/cpan123/pan.py +479 -0
  50. cpan123-0.1.0/src/cpan123/share.py +124 -0
  51. cpan123-0.1.0/src/cpan123/user.py +18 -0
  52. cpan123-0.1.0/src/cpan123/utils/__init__.py +0 -0
  53. cpan123-0.1.0/src/cpan123/utils/api.py +445 -0
  54. cpan123-0.1.0/src/cpan123/utils/baseapiclient.py +116 -0
  55. cpan123-0.1.0/src/cpan123/utils/checkdata.py +230 -0
  56. cpan123-0.1.0/src/cpan123/utils/md5.py +28 -0
  57. cpan123-0.1.0/tests/__init__.py +0 -0
  58. cpan123-0.1.0/tests/listv2.json +165 -0
  59. cpan123-0.1.0/tests/test_directlink.py +33 -0
  60. cpan123-0.1.0/tests/test_file.py +40 -0
  61. cpan123-0.1.0/tests/test_json.py +23 -0
  62. cpan123-0.1.0/tests/test_oss.py +33 -0
  63. cpan123-0.1.0/tests/test_share.py +47 -0
  64. cpan123-0.1.0/tests/test_trash.py +27 -0
  65. cpan123-0.1.0/tests/test_user.py +10 -0
  66. cpan123-0.1.0/uv.lock +1076 -0
@@ -0,0 +1,18 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+ .ruff_cache
12
+ .pytest_cache
13
+ .vscode
14
+ *.rar
15
+ *.zip
16
+ drop
17
+ 图吧工具箱2409安装程序.exe
18
+ t.py
@@ -0,0 +1 @@
1
+ 3.10
@@ -0,0 +1,23 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ # Required
5
+ version: 2
6
+
7
+ # Set the OS, Python version, and other tools you might need
8
+ build:
9
+ os: ubuntu-24.04
10
+ tools:
11
+ python: "3.12"
12
+
13
+ # Build documentation with Mkdocs
14
+ mkdocs:
15
+ configuration: mkdocs.yml
16
+
17
+ # Optionally, but recommended,
18
+ # declare the Python requirements required to build your documentation
19
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20
+ python:
21
+ install:
22
+ - requirements: docs/requirements.txt
23
+
@@ -0,0 +1,4 @@
1
+ ## 20250517
2
+
3
+ - 初次提交, 可能存在bug. 使用中慢慢发现bug.
4
+
cpan123-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.4
2
+ Name: cpan123
3
+ Version: 0.1.0
4
+ Summary: 123云盘的python接口文档(非官方)
5
+ Project-URL: Homepage, https://github.com/zoushucai/cpan123
6
+ Project-URL: Documentation, https://cpan123.readthedocs.org
7
+ Project-URL: Repository, https://github.com/zoushucai/cpan123.git
8
+ Project-URL: Issues, https://github.com/zoushucai/cpan123/issues
9
+ Project-URL: Changelog, https://github.com/zoushucai/cpan123/blob/main/CHANGELOG.md
10
+ Author-email: zoushucai <zoushucai@users.noreply.github.com>
11
+ Requires-Python: >=3.10
12
+ Requires-Dist: json5>=0.10.0
13
+ Requires-Dist: jsonpath>=0.6.0
14
+ Requires-Dist: py3-wget>=1.0.0
15
+ Requires-Dist: pydantic>=2.1.0
16
+ Requires-Dist: requests>=2.10.0
17
+ Requires-Dist: tenacity>=8.0.0
18
+ Description-Content-Type: text/markdown
19
+
20
+
21
+ ## cpan123
22
+
23
+ 这是一个非官方的123云盘开放平台调用库,可以轻松的在Python中调用123云盘开放平台而不需要多次编写重复的代码
24
+
25
+ 文档: [cpan123.readthedocs.io](https://cpan123.readthedocs.io/)
26
+
@@ -0,0 +1,7 @@
1
+
2
+ ## cpan123
3
+
4
+ 这是一个非官方的123云盘开放平台调用库,可以轻松的在Python中调用123云盘开放平台而不需要多次编写重复的代码
5
+
6
+ 文档: [cpan123.readthedocs.io](https://cpan123.readthedocs.io/)
7
+
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,8 @@
1
+
2
+ ## Auth 类
3
+
4
+ ::: cpan123.utils.api.Auth
5
+ options:
6
+ members:
7
+ - set_access_token
8
+ - refresh_access_token
@@ -0,0 +1,9 @@
1
+
2
+ ## 数据检查
3
+
4
+ ::: cpan123.utils.checkdata
5
+ options:
6
+ members:
7
+ - DataResponse
8
+ - BaseResponse
9
+ - JsonInput
@@ -0,0 +1,5 @@
1
+
2
+ ## 直链
3
+
4
+
5
+ ::: cpan123.directlink
@@ -0,0 +1,3 @@
1
+ ## 文件类
2
+
3
+ ::: cpan123.file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 440 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M344 305.5c-17.5 31.6-57.4 54.5-96 54.5-56.6 0-104-47.4-104-104s47.4-104 104-104c38.6 0 78.5 22.9 96 54.5 13.7-50.9 41.7-93.3 87-117.8C385.7 39.1 320.5 8 248 8 111 8 0 119 0 256s111 248 248 248c72.5 0 137.7-31.1 183-80.7-45.3-24.5-73.3-66.9-87-117.8z"/></svg>
@@ -0,0 +1,120 @@
1
+
2
+ ## cpan123
3
+
4
+ 这是一个非官方的123云盘开放平台调用库,可以轻松的在Python中调用123云盘开放平台而不需要多次编写重复的代码
5
+
6
+
7
+ - 已有的python库
8
+
9
+ - [pan123](https://pypi.org/project/pan123/)
10
+
11
+ - [123pan](https://github.com/wojiaoyishang/123pan)
12
+
13
+ 优势:
14
+
15
+ - 主要对返回的结果做了类型检查, 防止网络异常等不知道什么情况下导致的错误
16
+
17
+ - 上传文件采用多线程.
18
+
19
+ - 下载文件采用第三方库, `pip install py3-wget`
20
+
21
+ 吐槽:
22
+
23
+ - 123云盘有些时候抽风, 对于同一段代码, 有时候能成功, 有时候不能成功, 可能是网络问题, 也可能是123云盘的问题.
24
+ - 同一个文件在网盘上有多份, 有可能居然找不到? 不知道什么怎么回事.(感觉是123云盘抽风)
25
+
26
+
27
+ ### 安装
28
+ ```bash
29
+ pip install cpan123
30
+ ```
31
+
32
+ ### 授权
33
+
34
+
35
+ !!! note
36
+ 建议使用环境变量, token和client_id 二选一即可.
37
+
38
+ - PAN123TOKEN: 授权 token
39
+ - PAN123TOKEN_EXPIREDAT: 授权 token 过期时间
40
+ - PAN123CLIENTID: 客户端 ID
41
+ - PAN123CLIENTSECRET: 客户端密钥
42
+
43
+
44
+ ```python
45
+ # 方式1: 使用环境变量中的授权信息
46
+ from cpan123 import Pan123openAPI
47
+ pan123 = Pan123openAPI()
48
+
49
+ # 方式2: 使用授权信息
50
+ from cpan123 import Pan123openAPI, Auth
51
+ auth = Auth(clientID="your_client_id", clientSecret="your_client_secret")
52
+ print(auth.access_token) # 打印 access_token
53
+
54
+ # 或者
55
+ auth = Auth(access_token="your_access_token")
56
+ print(auth.access_token) # 打印 access_token
57
+
58
+ # 然后传入 Pan123openAPI中
59
+ pan123 = Pan123openAPI(auth=auth)
60
+
61
+ ```
62
+
63
+ ### 使用
64
+
65
+ ```python
66
+ from cpan123 import Pan123openAPI
67
+ from pathlib import Path
68
+
69
+ pan123 = Pan123openAPI()
70
+
71
+ # # 下载单个文件
72
+ fname = "xxxx.pt"
73
+ pan123.download(fname)
74
+
75
+ # # 下载多个文件
76
+ # filenames = ["xxxx1.pt", "xxx2.pt"]
77
+ # pan123.download(filenames)
78
+ # 上传文件
79
+ fname = "xxxxx.zip"
80
+ pan123.upload(fname, fname, 0, overwrite=True)
81
+ print("上传完成")
82
+
83
+ # 上传文件到oss(图床)
84
+ imgfile = "xxxx.png"
85
+ res = pan123.upload_oss(imgfile, Path(imgfile).name)
86
+ print(res)
87
+ ```
88
+
89
+ - 推荐上传与下载的文件都在根目录下, 且是文件
90
+
91
+ - 如果一个文件在云端过多, 可能会出一定的bug, 我遇到过, 当同一个文件在云端回收站和根目录下都有时, 下载时会过滤, 结果发现找不到非回收站的文件. 猜测和缓存之类的有关
92
+
93
+
94
+
95
+ ### 个人主要用的三个功能已封装.
96
+
97
+ - [x] 上传文件
98
+ - [x] 下载文件
99
+ - [x] 上传图片到oss
100
+
101
+ 建议单个文件下载与上传, 暂不支持文件夹的上传与下载.
102
+
103
+ ### 已实现的接口
104
+
105
+ - [x] 文件管理
106
+ - [x] 分享管理
107
+ - [x] 离线下载
108
+ - [x] 用户管理
109
+ - [x] 直链
110
+ - [x] 图床
111
+ - [ ] 视频转码
112
+ - 容量需要单独购买, 目前不支持对接
113
+
114
+
115
+
116
+ ## 参考:
117
+
118
+ - [123云盘开放平台](https://123yunpan.yuque.com/org-wiki-123yunpan-muaork/cr6ced/ppsuasz6rpioqbyt)
119
+
120
+
@@ -0,0 +1,118 @@
1
+
2
+ ## 接口
3
+
4
+ 所有的接口采用json文件存储, 一个文件对应一个类接口, 全部存储在 `src/cpan123/apijson` 中
5
+ ```bash
6
+
7
+ src/cpan123/apijson
8
+ ├── directlink.json
9
+ ├── file.json
10
+ ├── offline.json
11
+ ├── oss.json
12
+ ├── share.json
13
+ └── user.json
14
+ ```
15
+
16
+ ## 举例
17
+ - 官方的接口 : [获取文件列表](https://123yunpan.yuque.com/org-wiki-123yunpan-muaork/cr6ced/zrip9b0ye81zimv4)
18
+
19
+ - 对应的json文件接口的实现, 引入了一些额外的字段:
20
+ - `schema_` : 是对接口返回值的描述, 用于验证返回值的正确性, 验证返回的data字段是否符合这个描述,
21
+ - `response_schema` : 是对接口返回值的描述, 用于验证返回值的正确性(与上面的区别,在于这个是简单的验证,只要返回的字段中存在指定的key, 就可以了)
22
+ - `comment` : 是对接口的描述,无意义
23
+
24
+ - 只能包含以下字段: `method`, `url`, `data`, `params`, `schema_`, `comment`, `response_schema`
25
+
26
+
27
+ - 下面是获取文件列表的接口的json文件, 其中`list_v2`是接口的名称, `method`是请求方式, `url`是请求的url, `params`是请求参数, `schema_`是返回值的描述, `comment`是对接口的描述
28
+
29
+ - 采用json5的方式读入, 因此可以写注释.
30
+
31
+ - 其中 `params` 和`data` 的格式是一样的, 他们对应下面都是一个dict(没有可以为null或不写), 其值我们不关心,但是其key后续会被用到,应该和python的接口保持一致
32
+
33
+
34
+ ```json
35
+ {
36
+ ....
37
+
38
+ "list_v2": {
39
+ "method": "get",
40
+ "url": "/api/v2/file/list",
41
+ "params": {
42
+ "parentFileId": "number: required",
43
+ "limit": "number: required",
44
+ "searchData": "string: optional",
45
+ "searchMode": "number: optional",
46
+ "lastFileId": "number: optional"
47
+ },
48
+ "schema_": {
49
+ "type": "object",
50
+ "properties": {
51
+ "lastFileId": { "type": "number" },
52
+ "fileList": {
53
+ "type": "array",
54
+ "items": {
55
+ "type": "object",
56
+ "properties": {
57
+ "fileId": { "type": "number" },
58
+ "filename": { "type": "string" },
59
+ "type": { "type": "number", "enum": [0, 1] },
60
+ "etag": { "type": "string" },
61
+ "size": { "type": "number" },
62
+ "status": { "type": "number" },
63
+ "parentFileId": { "type": "number" },
64
+ "category": { "type": "number" }, //"enum": [0, 1, 2, 3] 实际情况可以出现5,而文档写的是0-4, 因此不要
65
+ "trashed": { "type": "number", "enum": [0, 1] }
66
+ },
67
+ "required": ["fileId", "filename", "type", "size", "etag", "status", "parentFileId", "category", "trashed"]
68
+ }
69
+ }
70
+ },
71
+ "required": ["lastFileId", "fileList"]
72
+ }
73
+ },
74
+ ....
75
+ }
76
+ ```
77
+
78
+ 只需要在python中引入即可
79
+
80
+ ```python
81
+ # 引入必要的类
82
+
83
+ class File(BaseApiClient):
84
+ def __init__(self, auth: Optional[Auth] = None) -> None:
85
+ super().__init__(filepath="file", auth=auth) # 这里的filepath对应上面的json文件名,不需要后缀
86
+
87
+ ...
88
+ ...
89
+
90
+
91
+ @auto_args_call_api("list_v2")
92
+ def list_v2(
93
+ self,
94
+ parentFileId: int,
95
+ limit: int = Field(default=100, gt=0, le=100),
96
+ searchData: Optional[str] = None,
97
+ searchMode: Optional[int] = 0,
98
+ lastFileId: Optional[int] = None,
99
+ skip: bool = False,
100
+ ) -> DataResponse: # type: ignore
101
+ """获取文件列表(V2版本, v1弃用)
102
+
103
+ Args:
104
+ parentFileId (int): 文件夹ID,根目录传 0
105
+ limit (int): 每页文件数量,最大不超过100
106
+ searchData (str, optional):搜索关键字将无视文件夹ID参数. 将会进行全局查找
107
+ searchMode (int, optional): 搜索模式,0:模糊搜索,1:精确搜索,默认为0
108
+ lastFileId (int, optional): 翻页查询时需要填写
109
+ skip (bool): 是否跳过响应数据的模式校验
110
+ """
111
+ # 这里的函数体根本不会执行, 因为被装饰器给劫持了, 返回的结果是装饰器的返回值,所以对参数进行校验无效
112
+ # 如果要对参数进行校验,需要 Field 等参数校验方法
113
+ # 默认已开启函数参数校验
114
+ # 总结: 所以完全不用写函数体
115
+
116
+ ...
117
+ ...
118
+ ```
@@ -0,0 +1,19 @@
1
+ window.MathJax = {
2
+ tex: {
3
+ inlineMath: [["\\(", "\\)"]],
4
+ displayMath: [["\\[", "\\]"]],
5
+ processEscapes: true,
6
+ processEnvironments: true,
7
+ },
8
+ options: {
9
+ ignoreHtmlClass: ".*|",
10
+ processHtmlClass: "arithmatex",
11
+ },
12
+ };
13
+
14
+ document$.subscribe(() => {
15
+ MathJax.startup.output.clearCache();
16
+ MathJax.typesetClear();
17
+ MathJax.texReset();
18
+ MathJax.typesetPromise();
19
+ });
@@ -0,0 +1,5 @@
1
+
2
+ ## 离线下载
3
+
4
+ ::: cpan123.offline
5
+
@@ -0,0 +1,4 @@
1
+
2
+ ## 图床
3
+
4
+ ::: cpan123.oss
@@ -0,0 +1,3 @@
1
+ # Pan123openAPI 主接口
2
+
3
+ ::: cpan123.pan
@@ -0,0 +1,8 @@
1
+ mkdocs==1.6.1
2
+ mkdocs-autorefs==1.4.1
3
+ mkdocs-get-deps==0.2.0
4
+ mkdocs-material==9.6.12
5
+ mkdocs-material-extensions==1.3.1
6
+ mkdocstrings==0.29.1
7
+ mkdocstrings-python==1.16.10
8
+ black==25.1.0
@@ -0,0 +1,4 @@
1
+
2
+ ## Share 类
3
+
4
+ ::: cpan123.share
@@ -0,0 +1,3 @@
1
+ ## 用户信息
2
+
3
+ ::: cpan123.user
@@ -0,0 +1,147 @@
1
+ #[Info]
2
+ site_name: 123云盘的python接口文档
3
+ site_description: 123云盘的python接口文档(非官方)
4
+ site_author: zsc
5
+
6
+ nav:
7
+ - 介绍: index.md
8
+ - 主接口: pan.md
9
+ - Auth类: auth.md
10
+ - File类: file.md
11
+ - Share类: share.md
12
+ - Offline 类: offline.md
13
+ - User类: user.md
14
+ - DirectLink 类: directlink.md
15
+ - Oss 类: oss.md
16
+ - 更多:
17
+ - 数据验证: checkdata.md
18
+ - 接口的编写: interface.md
19
+
20
+ edit_uri: edit/main/docs # 编辑按钮跳转的链接
21
+ repo_url: https://github.com/zoushucai/cpan123 # 右上角点击跳转的链接
22
+ repo_name: cpan123 # 右上角的名字
23
+ copyright: Copyright &copy 2025 by zsc; # 左下角的版权声明
24
+ extra:
25
+ social:
26
+ - icon: fontawesome/brands/github
27
+ link: https://github.com/zoushucai
28
+ name: GitHub ##网页右下角的图标链接
29
+ theme:
30
+ name: material
31
+ language: zh
32
+ icon:
33
+ repo: fontawesome/brands/github #右上角图标
34
+ logo: fontawesome/brands/cuttlefish #左上角图标
35
+ favicon: images/cuttlefish.svg
36
+ palette:
37
+ - media: "(prefers-color-scheme)"
38
+ toggle:
39
+ icon: material/brightness-auto
40
+ name: Switch to light mode
41
+ - media: "(prefers-color-scheme: light)"
42
+ scheme: default
43
+ primary: teal
44
+ accent: purple
45
+ toggle:
46
+ icon: material/weather-sunny
47
+ name: Switch to dark mode
48
+ - media: "(prefers-color-scheme: dark)"
49
+ scheme: slate
50
+ primary: black
51
+ accent: lime
52
+ toggle:
53
+ icon: material/weather-night
54
+ name: Switch to system preference
55
+ features:
56
+ - announce.dismiss #呈现可标记为由用户读取的临时公告,可以包含一个用于取消当前公告的按钮
57
+ - navigation.instant # 现在页面不会跳转,而是类似单页应用,搜索和各种跳转都是在当前页面完成,对美观有很大帮助
58
+ - header.autohide #自动隐藏顶部标题(在观看文章的时候会自动隐藏,滑动鼠标的时候会自动显示)
59
+ - navigation.tracking #地址栏中的 URL 将自动更新为在目录中突出显示的活动锚点
60
+ - navigation.tabs #顶级部分将呈现在上面视口标题下方的菜单层中,但在移动设备上保持原样
61
+ - navigation.tabs.sticky #启用粘性选项卡后,导航选项卡将锁定在标题下方,并在向下滚动时始终保持可见
62
+ - navigation.sections #启用部分后,顶级部分在边栏中呈现为1220px以上视口的组,但在移动设备上保持原样
63
+ - navigation.top # 返回顶部的按钮 在上滑时出现
64
+ - navigation.footer #页脚将呈现在边栏中,但在移动设备上保持原样.,# 页脚提示下一章
65
+ - search.suggest # 搜索输入一些字母时推荐补全整个单词
66
+ - search.highlight # 搜索出的文章关键词加入高亮
67
+ - search.share #搜索分享按钮
68
+ - navigation.expand # 打开Tab时左侧目录全部展开
69
+ - navigation.indexes #启用节索引页后,可以将文档直接附加到节
70
+ - content.tabs.link
71
+ - content.tooltips
72
+ - content.code.copy #代码复制
73
+ - content.action.edit
74
+ - content.action.view
75
+ - content.code.annotate
76
+
77
+ plugins:
78
+ - search #搜索配置
79
+ - autorefs #自动引用
80
+ - mkdocstrings:
81
+ handlers:
82
+ python:
83
+ paths: ["src"] # 需要解析的路径
84
+ options:
85
+ # filters: #付费功能
86
+ # - "!^_[^_]"
87
+ members_order: source
88
+ heading_level: 3 # 解析的函数的标题级别
89
+ show_root_full_path: true #显示根对象标题的完整 Python 路径,默认为true
90
+ # show_root_members_full_path: true #显示根成员的完整 Python 路径. 默认为false
91
+ # show_object_full_path: true #递归显示每个成员的完整路径, (默认为false)
92
+ parameter_headings: false #显示参数标题(默认为false)
93
+ show_root_toc_entry: true #显示根对象的目录项(默认为true)
94
+ # summary: true
95
+ show_symbol_type_heading: true #显示符号类型标题(默认为false,建议开启)
96
+ show_symbol_type_toc: true #显示符号类型目录项(默认为false,建议开启)
97
+ show_labels: true #显示标签(默认为true)
98
+ docstring_style: google #google风格的文档字符串
99
+ show_signature: true #显示方法和函数签名.
100
+ separate_signature: true #是否将整个签名放在标题下方的代码块中.
101
+ show_signature_annotations: true #在方法和函数签名中显示类型注释.
102
+ # signature_crossrefs: true
103
+ show_source: true #显示源代码链接(默认为true)
104
+
105
+ ##### 看官网: https://squidfunk.github.io/mkdocs-material/setup/extensions/ #####
106
+ extra_javascript:
107
+ - javascripts/mathjax.js
108
+ - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
109
+
110
+ markdown_extensions:
111
+ # Python Markdown
112
+ - abbr
113
+ - admonition
114
+ - attr_list
115
+ - def_list
116
+ - footnotes
117
+ - md_in_html
118
+ - toc:
119
+ permalink: true # 固定标题位置为当前位置
120
+ # Python Markdown Extensions,需要额外加载本地js文件
121
+ - pymdownx.arithmatex:
122
+ generic: true
123
+ - pymdownx.betterem:
124
+ smart_enable: all
125
+ - pymdownx.caret
126
+ - pymdownx.critic:
127
+ mode: view #显示文档中添加、删除或更新的部分
128
+ - pymdownx.details
129
+ - pymdownx.emoji:
130
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
131
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
132
+ - pymdownx.highlight:
133
+ anchor_linenums: true
134
+ linenums: true # 显示行号
135
+ # auto_title: true # 显示编程语言名称
136
+ - pymdownx.inlinehilite
137
+ - pymdownx.keys
138
+ - pymdownx.mark
139
+ - pymdownx.smartsymbols
140
+ - pymdownx.superfences
141
+ - pymdownx.tabbed:
142
+ alternate_style: true
143
+ - pymdownx.tasklist:
144
+ custom_checkbox: true #切换复选框的渲染样式
145
+ - pymdownx.tilde
146
+
147
+
@@ -0,0 +1,54 @@
1
+ [project]
2
+ name = "cpan123"
3
+ version = "0.1.0"
4
+ description = "123云盘的python接口文档(非官方)"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "zoushucai", email = "zoushucai@users.noreply.github.com" }
8
+ ]
9
+ requires-python = ">=3.10"
10
+ dependencies = [
11
+ "json5>=0.10.0",
12
+ "jsonpath>=0.6.0",
13
+ "py3-wget>=1.0.0",
14
+ "pydantic>=2.1.0",
15
+ "requests>=2.10.0",
16
+ "tenacity>=8.0.0",
17
+ ]
18
+
19
+ [project.scripts]
20
+ cpan123 = "cpan123:main"
21
+
22
+ [build-system]
23
+ requires = ["hatchling"]
24
+ build-backend = "hatchling.build"
25
+
26
+ [tool.pytest.ini_options]
27
+ testpaths = ["tests"]
28
+ python_files = "test_*.py"
29
+ python_functions = "test_*"
30
+
31
+
32
+ [tool.ruff.lint]
33
+ extend-select = ["I", "B"]
34
+ [dependency-groups]
35
+ dev = [
36
+ "black>=25.1.0",
37
+ "jsonschema>=4.23.0",
38
+ "mkdocs>=1.6.1",
39
+ "mkdocs-autorefs>=1.4.1",
40
+ "mkdocs-get-deps>=0.2.0",
41
+ "mkdocs-material>=9.6.14",
42
+ "mkdocs-material-extensions>=1.3.1",
43
+ "mkdocstrings>=0.29.1",
44
+ "mkdocstrings-python>=1.16.10",
45
+ "pytest>=8.3.5",
46
+ "ruff>=0.11.8",
47
+ ]
48
+
49
+ [project.urls]
50
+ Homepage = "https://github.com/zoushucai/cpan123"
51
+ Documentation = "https://cpan123.readthedocs.org"
52
+ Repository = "https://github.com/zoushucai/cpan123.git"
53
+ Issues = "https://github.com/zoushucai/cpan123/issues"
54
+ Changelog = "https://github.com/zoushucai/cpan123/blob/main/CHANGELOG.md"
@@ -0,0 +1,3 @@
1
+ from .pan import Auth, Pan123openAPI
2
+
3
+ __all__ = ["Pan123openAPI", "Auth"]
File without changes