pansh 3.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.
- pansh-3.1.0/.gitignore +10 -0
- pansh-3.1.0/LICENSE +21 -0
- pansh-3.1.0/PKG-INFO +124 -0
- pansh-3.1.0/README.md +100 -0
- pansh-3.1.0/pyproject.toml +62 -0
- pansh-3.1.0/src/pansh/__init__.py +5 -0
- pansh-3.1.0/src/pansh/__main__.py +6 -0
- pansh-3.1.0/src/pansh/api.py +477 -0
- pansh-3.1.0/src/pansh/auth.py +152 -0
- pansh-3.1.0/src/pansh/config.py +78 -0
- pansh-3.1.0/src/pansh/core.py +603 -0
- pansh-3.1.0/src/pansh/defaults/settings.yaml +22 -0
- pansh-3.1.0/src/pansh/main.py +994 -0
- pansh-3.1.0/src/pansh/models.py +160 -0
- pansh-3.1.0/src/pansh/network.py +290 -0
- pansh-3.1.0/src/pansh/progress.py +146 -0
- pansh-3.1.0/src/pansh/selectors.py +104 -0
- pansh-3.1.0/src/pansh/settings.py +147 -0
- pansh-3.1.0/src/pansh/shell.py +271 -0
- pansh-3.1.0/src/pansh/theme.py +85 -0
- pansh-3.1.0/src/pansh/transfer.py +180 -0
- pansh-3.1.0/src/pansh/version.py +3 -0
- pansh-3.1.0/tests/test_packaging.py +28 -0
- pansh-3.1.0/tests/test_progress.py +19 -0
- pansh-3.1.0/tests/test_selectors.py +33 -0
- pansh-3.1.0/tests/test_settings.py +16 -0
pansh-3.1.0/.gitignore
ADDED
pansh-3.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 xdedss
|
|
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.
|
pansh-3.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pansh
|
|
3
|
+
Version: 3.1.0
|
|
4
|
+
Summary: AnyShare / 北航网盘 CLI with Typer, Rich, and asyncio
|
|
5
|
+
Author: LZR
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Requires-Dist: httpx>=0.27.0
|
|
10
|
+
Requires-Dist: platformdirs>=4.2.0
|
|
11
|
+
Requires-Dist: prompt-toolkit>=3.0.43
|
|
12
|
+
Requires-Dist: pydantic>=2.7.0
|
|
13
|
+
Requires-Dist: pyyaml>=6.0
|
|
14
|
+
Requires-Dist: rich>=13.7.1
|
|
15
|
+
Requires-Dist: rsa>=4.9
|
|
16
|
+
Requires-Dist: typer>=0.12.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: build>=1.2.2; extra == 'dev'
|
|
19
|
+
Requires-Dist: mypy>=1.10.0; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
21
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
22
|
+
Requires-Dist: twine>=6.2.0; extra == 'dev'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# pansh
|
|
26
|
+
|
|
27
|
+
AnyShare / 北航网盘命令行工具,支持:
|
|
28
|
+
|
|
29
|
+
- `pip install .` / `pip install -e .`
|
|
30
|
+
- `pansh` / `python -m pansh`
|
|
31
|
+
- Typer 单次命令与交互式 shell
|
|
32
|
+
- Rich 进度条、实时速率、平均速率、ETA、状态
|
|
33
|
+
- 多文件、`glob`、`regex` 上传下载
|
|
34
|
+
- `platformdirs` 用户配置目录
|
|
35
|
+
- YAML 设置文件和 JSON 凭据缓存
|
|
36
|
+
|
|
37
|
+
## 安装
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install -e .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
安装后可直接使用:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pansh --help
|
|
47
|
+
python -m pansh --help
|
|
48
|
+
pansh --version
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 配置目录
|
|
52
|
+
|
|
53
|
+
默认配置目录使用 `platformdirs.user_config_dir("pansh")`。
|
|
54
|
+
|
|
55
|
+
典型文件布局:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
settings.yaml
|
|
59
|
+
auth.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
支持环境变量覆盖配置文件路径:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pansh_CONFIG=/path/to/settings.yaml
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
首次运行会自动生成内置默认 `settings.yaml` 模板。
|
|
69
|
+
|
|
70
|
+
## 常用命令
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pansh ls home
|
|
74
|
+
pansh stat home/file.pdf
|
|
75
|
+
pansh whoami --json
|
|
76
|
+
pansh quota --json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 上传
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pansh upload a.txt b.txt c.txt home/test -y
|
|
83
|
+
pansh upload --glob "*.pdf" --glob "*.docx" home/test -y
|
|
84
|
+
pansh upload --regex ".*\\.(pdf|docx)$" ./docs home/test --recursive -y
|
|
85
|
+
pansh upload src1 src2 src3 --exclude "*.tmp" home/test -y
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 下载
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pansh download home/a.pdf home/b.pdf ./downloads -y
|
|
92
|
+
pansh download --glob "*.zip" ./downloads -y
|
|
93
|
+
pansh download --regex ".*2026.*\\.pdf$" home/docs ./downloads --recursive -y
|
|
94
|
+
pansh download --search --regex ".*报告.*" --range home/docs ./downloads -y
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 输出模式
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pansh ls home --plain
|
|
101
|
+
pansh ls home --json
|
|
102
|
+
pansh find 报告 --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Shell
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pansh
|
|
109
|
+
pansh shell
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
交互模式内置命令:
|
|
113
|
+
|
|
114
|
+
- `cd`, `pwd`
|
|
115
|
+
- `lcd`, `lpwd`, `lls`
|
|
116
|
+
- `!<cmd>` 执行本地 shell 命令
|
|
117
|
+
- 其余命令复用同一套 CLI 实现
|
|
118
|
+
|
|
119
|
+
## 进阶命令
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pansh revisions home/file.docx
|
|
123
|
+
pansh restore-revision home/file.docx REVISION_ID
|
|
124
|
+
```
|
pansh-3.1.0/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# pansh
|
|
2
|
+
|
|
3
|
+
AnyShare / 北航网盘命令行工具,支持:
|
|
4
|
+
|
|
5
|
+
- `pip install .` / `pip install -e .`
|
|
6
|
+
- `pansh` / `python -m pansh`
|
|
7
|
+
- Typer 单次命令与交互式 shell
|
|
8
|
+
- Rich 进度条、实时速率、平均速率、ETA、状态
|
|
9
|
+
- 多文件、`glob`、`regex` 上传下载
|
|
10
|
+
- `platformdirs` 用户配置目录
|
|
11
|
+
- YAML 设置文件和 JSON 凭据缓存
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install -e .
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
安装后可直接使用:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pansh --help
|
|
23
|
+
python -m pansh --help
|
|
24
|
+
pansh --version
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 配置目录
|
|
28
|
+
|
|
29
|
+
默认配置目录使用 `platformdirs.user_config_dir("pansh")`。
|
|
30
|
+
|
|
31
|
+
典型文件布局:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
settings.yaml
|
|
35
|
+
auth.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
支持环境变量覆盖配置文件路径:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pansh_CONFIG=/path/to/settings.yaml
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
首次运行会自动生成内置默认 `settings.yaml` 模板。
|
|
45
|
+
|
|
46
|
+
## 常用命令
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pansh ls home
|
|
50
|
+
pansh stat home/file.pdf
|
|
51
|
+
pansh whoami --json
|
|
52
|
+
pansh quota --json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 上传
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pansh upload a.txt b.txt c.txt home/test -y
|
|
59
|
+
pansh upload --glob "*.pdf" --glob "*.docx" home/test -y
|
|
60
|
+
pansh upload --regex ".*\\.(pdf|docx)$" ./docs home/test --recursive -y
|
|
61
|
+
pansh upload src1 src2 src3 --exclude "*.tmp" home/test -y
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 下载
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pansh download home/a.pdf home/b.pdf ./downloads -y
|
|
68
|
+
pansh download --glob "*.zip" ./downloads -y
|
|
69
|
+
pansh download --regex ".*2026.*\\.pdf$" home/docs ./downloads --recursive -y
|
|
70
|
+
pansh download --search --regex ".*报告.*" --range home/docs ./downloads -y
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 输出模式
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pansh ls home --plain
|
|
77
|
+
pansh ls home --json
|
|
78
|
+
pansh find 报告 --json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Shell
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pansh
|
|
85
|
+
pansh shell
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
交互模式内置命令:
|
|
89
|
+
|
|
90
|
+
- `cd`, `pwd`
|
|
91
|
+
- `lcd`, `lpwd`, `lls`
|
|
92
|
+
- `!<cmd>` 执行本地 shell 命令
|
|
93
|
+
- 其余命令复用同一套 CLI 实现
|
|
94
|
+
|
|
95
|
+
## 进阶命令
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pansh revisions home/file.docx
|
|
99
|
+
pansh restore-revision home/file.docx REVISION_ID
|
|
100
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25.0"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pansh"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "AnyShare / 北航网盘 CLI with Typer, Rich, and asyncio"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "LZR" }]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"httpx>=0.27.0",
|
|
15
|
+
"platformdirs>=4.2.0",
|
|
16
|
+
"prompt-toolkit>=3.0.43",
|
|
17
|
+
"pydantic>=2.7.0",
|
|
18
|
+
"pyyaml>=6.0",
|
|
19
|
+
"rich>=13.7.1",
|
|
20
|
+
"rsa>=4.9",
|
|
21
|
+
"typer>=0.12.0",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
dev = [
|
|
26
|
+
"build>=1.2.2",
|
|
27
|
+
"mypy>=1.10.0",
|
|
28
|
+
"pytest>=8.0.0",
|
|
29
|
+
"ruff>=0.4.0",
|
|
30
|
+
"twine>=6.2.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
pansh = "pansh.main:main"
|
|
35
|
+
bhpan = "pansh.main:main"
|
|
36
|
+
|
|
37
|
+
[tool.hatch.version]
|
|
38
|
+
path = "src/pansh/version.py"
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.wheel]
|
|
41
|
+
packages = ["src/pansh"]
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.sdist]
|
|
44
|
+
include = [
|
|
45
|
+
"/src",
|
|
46
|
+
"/tests",
|
|
47
|
+
"/README.md",
|
|
48
|
+
"/pyproject.toml",
|
|
49
|
+
"/LICENSE",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[tool.pytest.ini_options]
|
|
53
|
+
norecursedirs = [
|
|
54
|
+
".venv",
|
|
55
|
+
".pytest_cache",
|
|
56
|
+
".pytest-tmp",
|
|
57
|
+
".tmp",
|
|
58
|
+
".tmp-settings",
|
|
59
|
+
"dist",
|
|
60
|
+
"build",
|
|
61
|
+
"pytest-cache-files-*",
|
|
62
|
+
]
|