damon-devtools 0.3.0__tar.gz → 0.5.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 (34) hide show
  1. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/PKG-INFO +4 -1
  2. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/README.md +115 -115
  3. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/damon_devtools.egg-info/PKG-INFO +4 -1
  4. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/damon_devtools.egg-info/SOURCES.txt +5 -1
  5. damon_devtools-0.5.0/damon_devtools.egg-info/requires.txt +4 -0
  6. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/__init__.py +2 -2
  7. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/__main__.py +63 -63
  8. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/launcher.py +44 -44
  9. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/__init__.py +35 -29
  10. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/apkpull/__init__.py +1 -1
  11. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/apkpull/__main__.py +4 -4
  12. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/apkpull/core.py +460 -303
  13. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/apkpull/models.py +5 -5
  14. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/apkpull/ui.py +212 -183
  15. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/portkill/__init__.py +1 -1
  16. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/portkill/__main__.py +6 -6
  17. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/portkill/core.py +97 -97
  18. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/portkill/models.py +17 -17
  19. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/portkill/ui.py +203 -203
  20. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/removebg/__main__.py +5 -5
  21. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/removebg/cli.py +80 -80
  22. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/removebg/core.py +66 -66
  23. damon_devtools-0.5.0/devtools/tools/url2md/__init__.py +0 -0
  24. damon_devtools-0.5.0/devtools/tools/url2md/__main__.py +5 -0
  25. damon_devtools-0.5.0/devtools/tools/url2md/cli.py +111 -0
  26. damon_devtools-0.5.0/devtools/tools/url2md/core.py +92 -0
  27. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/types.py +9 -9
  28. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/pyproject.toml +24 -24
  29. damon_devtools-0.3.0/damon_devtools.egg-info/requires.txt +0 -1
  30. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/damon_devtools.egg-info/dependency_links.txt +0 -0
  31. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/damon_devtools.egg-info/entry_points.txt +0 -0
  32. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/damon_devtools.egg-info/top_level.txt +0 -0
  33. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/devtools/tools/removebg/__init__.py +0 -0
  34. {damon_devtools-0.3.0 → damon_devtools-0.5.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: damon-devtools
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: Developer CLI tools — portkill, removebg, apkpull
5
5
  Author: damon
6
6
  License: MIT
@@ -8,6 +8,9 @@ Keywords: cli,devtools,android,apk,adb
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
10
10
  Requires-Dist: psutil>=5.9
11
+ Requires-Dist: markdownify
12
+ Requires-Dist: beautifulsoup4
13
+ Requires-Dist: requests
11
14
 
12
15
  # devtools
13
16
 
@@ -1,115 +1,115 @@
1
- # devtools
2
-
3
- Developer CLI tools: portkill, removebg, apkpull.
4
-
5
- ---
6
-
7
- ## Tools
8
-
9
- ### portkill
10
-
11
- Kill Node.js processes by port or scan all node processes.
12
-
13
- ```bash
14
- python -m devtools portkill
15
- python -m devtools portkill --listen-only
16
- ```
17
-
18
- ### apkpull
19
-
20
- Pull APK files from Android device via ADB.
21
-
22
- Features:
23
- - List and search third-party apps
24
- - Fast app name lookup via aapt2
25
- - Auto-download aapt2 if not found locally
26
- - Multi-device support
27
- - Label caching for faster subsequent runs
28
-
29
- ```bash
30
- # Interactive mode
31
- python -m devtools apkpull
32
-
33
- # Specify target directory
34
- python -m devtools apkpull /path/to/output
35
-
36
- # Search apps by keyword
37
- python -m devtools apkpull -s wechat
38
- ```
39
-
40
- ### removebg
41
-
42
- Remove image backgrounds using the remove.bg API.
43
-
44
- ```bash
45
- python -m devtools removebg input.jpg
46
- ```
47
-
48
- ---
49
-
50
- ## Install
51
-
52
- ```bash
53
- pip install damon-devtools
54
- ```
55
-
56
- Requires: Python >= 3.10
57
-
58
- ---
59
-
60
- # devtools
61
-
62
- 开发者命令行工具集:portkill、removebg、apkpull。
63
-
64
- ---
65
-
66
- ## 工具
67
-
68
- ### portkill
69
-
70
- 根据端口查找并终止 Node.js 进程,或扫描所有 node 进程。
71
-
72
- ```bash
73
- python -m devtools portkill
74
- python -m devtools portkill --listen-only
75
- ```
76
-
77
- ### apkpull
78
-
79
- 通过 ADB 从 Android 设备拉取 APK 安装包。
80
-
81
- 功能特点:
82
- - 列出和搜索第三方应用
83
- - 通过 aapt2 快速获取应用名
84
- - 本地未找到 aapt2 时自动下载
85
- - 多设备支持
86
- - 应用名缓存,加速后续运行
87
-
88
- ```bash
89
- # 交互模式
90
- python -m devtools apkpull
91
-
92
- # 指定目标目录
93
- python -m devtools apkpull /path/to/output
94
-
95
- # 搜索应用
96
- python -m devtools apkpull -s wechat
97
- ```
98
-
99
- ### removebg
100
-
101
- 使用 remove.bg API 去除图片背景。
102
-
103
- ```bash
104
- python -m devtools removebg input.jpg
105
- ```
106
-
107
- ---
108
-
109
- ## 安装
110
-
111
- ```bash
112
- pip install damon-devtools
113
- ```
114
-
115
- 要求:Python >= 3.10
1
+ # devtools
2
+
3
+ Developer CLI tools: portkill, removebg, apkpull.
4
+
5
+ ---
6
+
7
+ ## Tools
8
+
9
+ ### portkill
10
+
11
+ Kill Node.js processes by port or scan all node processes.
12
+
13
+ ```bash
14
+ python -m devtools portkill
15
+ python -m devtools portkill --listen-only
16
+ ```
17
+
18
+ ### apkpull
19
+
20
+ Pull APK files from Android device via ADB.
21
+
22
+ Features:
23
+ - List and search third-party apps
24
+ - Fast app name lookup via aapt2
25
+ - Auto-download aapt2 if not found locally
26
+ - Multi-device support
27
+ - Label caching for faster subsequent runs
28
+
29
+ ```bash
30
+ # Interactive mode
31
+ python -m devtools apkpull
32
+
33
+ # Specify target directory
34
+ python -m devtools apkpull /path/to/output
35
+
36
+ # Search apps by keyword
37
+ python -m devtools apkpull -s wechat
38
+ ```
39
+
40
+ ### removebg
41
+
42
+ Remove image backgrounds using the remove.bg API.
43
+
44
+ ```bash
45
+ python -m devtools removebg input.jpg
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Install
51
+
52
+ ```bash
53
+ pip install damon-devtools
54
+ ```
55
+
56
+ Requires: Python >= 3.10
57
+
58
+ ---
59
+
60
+ # devtools
61
+
62
+ 开发者命令行工具集:portkill、removebg、apkpull。
63
+
64
+ ---
65
+
66
+ ## 工具
67
+
68
+ ### portkill
69
+
70
+ 根据端口查找并终止 Node.js 进程,或扫描所有 node 进程。
71
+
72
+ ```bash
73
+ python -m devtools portkill
74
+ python -m devtools portkill --listen-only
75
+ ```
76
+
77
+ ### apkpull
78
+
79
+ 通过 ADB 从 Android 设备拉取 APK 安装包。
80
+
81
+ 功能特点:
82
+ - 列出和搜索第三方应用
83
+ - 通过 aapt2 快速获取应用名
84
+ - 本地未找到 aapt2 时自动下载
85
+ - 多设备支持
86
+ - 应用名缓存,加速后续运行
87
+
88
+ ```bash
89
+ # 交互模式
90
+ python -m devtools apkpull
91
+
92
+ # 指定目标目录
93
+ python -m devtools apkpull /path/to/output
94
+
95
+ # 搜索应用
96
+ python -m devtools apkpull -s wechat
97
+ ```
98
+
99
+ ### removebg
100
+
101
+ 使用 remove.bg API 去除图片背景。
102
+
103
+ ```bash
104
+ python -m devtools removebg input.jpg
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 安装
110
+
111
+ ```bash
112
+ pip install damon-devtools
113
+ ```
114
+
115
+ 要求:Python >= 3.10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: damon-devtools
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: Developer CLI tools — portkill, removebg, apkpull
5
5
  Author: damon
6
6
  License: MIT
@@ -8,6 +8,9 @@ Keywords: cli,devtools,android,apk,adb
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
10
10
  Requires-Dist: psutil>=5.9
11
+ Requires-Dist: markdownify
12
+ Requires-Dist: beautifulsoup4
13
+ Requires-Dist: requests
11
14
 
12
15
  # devtools
13
16
 
@@ -24,4 +24,8 @@ devtools/tools/portkill/ui.py
24
24
  devtools/tools/removebg/__init__.py
25
25
  devtools/tools/removebg/__main__.py
26
26
  devtools/tools/removebg/cli.py
27
- devtools/tools/removebg/core.py
27
+ devtools/tools/removebg/core.py
28
+ devtools/tools/url2md/__init__.py
29
+ devtools/tools/url2md/__main__.py
30
+ devtools/tools/url2md/cli.py
31
+ devtools/tools/url2md/core.py
@@ -0,0 +1,4 @@
1
+ psutil>=5.9
2
+ markdownify
3
+ beautifulsoup4
4
+ requests
@@ -1,2 +1,2 @@
1
- """devtools - Developer tools CLI launcher"""
2
- __version__ = "0.1.0"
1
+ """devtools - Developer tools CLI launcher"""
2
+ __version__ = "0.1.0"
@@ -1,63 +1,63 @@
1
- import sys
2
- import argparse
3
- from importlib import import_module
4
- from importlib.metadata import version as get_version
5
- from devtools.tools import get_tool
6
-
7
- VERSION = get_version("damon-devtools")
8
-
9
-
10
- def run_tool(tool_name: str, args: list[str]):
11
- tool = get_tool(tool_name)
12
- if tool is None:
13
- print(f"Unknown tool: {tool_name}")
14
- print("Run `devtools` to see available tools.")
15
- sys.exit(1)
16
-
17
- module_name = tool.module
18
-
19
- # Try module.run directly (if tool exposes run at module root)
20
- mod = import_module(module_name)
21
- if hasattr(mod, "run"):
22
- mod.run(args)
23
- return
24
-
25
- # Try module.cli.run (removebg pattern)
26
- try:
27
- cli_mod = import_module(f"{module_name}.cli")
28
- if hasattr(cli_mod, "run"):
29
- cli_mod.run(args)
30
- return
31
- except ImportError:
32
- pass
33
-
34
- # Try module.ui.run (portkill pattern)
35
- try:
36
- ui_mod = import_module(f"{module_name}.ui")
37
- if hasattr(ui_mod, "run"):
38
- ui_mod.run(args)
39
- return
40
- except ImportError:
41
- pass
42
-
43
- print(f"Tool module {module_name} has no run() function")
44
- sys.exit(1)
45
-
46
-
47
- def main():
48
- parser = argparse.ArgumentParser(prog="devtools", description="Developer CLI tools")
49
- parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {VERSION}")
50
- parser.add_argument("tool", nargs="?", help="Tool name to run")
51
- parser.add_argument("args", nargs="*", help="Arguments for the tool")
52
- parsed = parser.parse_args()
53
-
54
- if parsed.tool:
55
- run_tool(parsed.tool, parsed.args)
56
- else:
57
- from devtools.launcher import render_launcher
58
- result = render_launcher()
59
- if result:
60
- run_tool(result, [])
61
-
62
- if __name__ == "__main__":
63
- main()
1
+ import sys
2
+ import argparse
3
+ from importlib import import_module
4
+ from importlib.metadata import version as get_version
5
+ from devtools.tools import get_tool
6
+
7
+ VERSION = get_version("damon-devtools")
8
+
9
+
10
+ def run_tool(tool_name: str, args: list[str]):
11
+ tool = get_tool(tool_name)
12
+ if tool is None:
13
+ print(f"Unknown tool: {tool_name}")
14
+ print("Run `devtools` to see available tools.")
15
+ sys.exit(1)
16
+
17
+ module_name = tool.module
18
+
19
+ # Try module.run directly (if tool exposes run at module root)
20
+ mod = import_module(module_name)
21
+ if hasattr(mod, "run"):
22
+ mod.run(args)
23
+ return
24
+
25
+ # Try module.cli.run (removebg pattern)
26
+ try:
27
+ cli_mod = import_module(f"{module_name}.cli")
28
+ if hasattr(cli_mod, "run"):
29
+ cli_mod.run(args)
30
+ return
31
+ except ImportError:
32
+ pass
33
+
34
+ # Try module.ui.run (portkill pattern)
35
+ try:
36
+ ui_mod = import_module(f"{module_name}.ui")
37
+ if hasattr(ui_mod, "run"):
38
+ ui_mod.run(args)
39
+ return
40
+ except ImportError:
41
+ pass
42
+
43
+ print(f"Tool module {module_name} has no run() function")
44
+ sys.exit(1)
45
+
46
+
47
+ def main():
48
+ parser = argparse.ArgumentParser(prog="devtools", description="Developer CLI tools")
49
+ parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {VERSION}")
50
+ parser.add_argument("tool", nargs="?", help="Tool name to run")
51
+ parser.add_argument("args", nargs="*", help="Arguments for the tool")
52
+ parsed = parser.parse_args()
53
+
54
+ if parsed.tool:
55
+ run_tool(parsed.tool, parsed.args)
56
+ else:
57
+ from devtools.launcher import render_launcher
58
+ result = render_launcher()
59
+ if result:
60
+ run_tool(result, [])
61
+
62
+ if __name__ == "__main__":
63
+ main()
@@ -1,44 +1,44 @@
1
- import sys
2
- if sys.platform == "win32":
3
- sys.stdout.reconfigure(encoding="utf-8")
4
-
5
- from devtools.tools import TOOLS
6
- from devtools.__main__ import VERSION
7
-
8
-
9
- def render_launcher():
10
- """
11
- CLI launcher — list all tools with numbers, read selection.
12
- Returns: tool name string to launch, or None to quit
13
- """
14
- if not TOOLS:
15
- print("No tools registered!")
16
- return None
17
-
18
- print()
19
- print("=" * 50)
20
- print(f" devtools {VERSION} — 开发者工具箱")
21
- print("=" * 50)
22
- print()
23
- for i, tool in enumerate(TOOLS):
24
- print(f" {i + 1}. {tool.name:15s} — {tool.description}")
25
- print()
26
- print(f" [1-{len(TOOLS)}] 选择工具 | [Q] 退出")
27
- print()
28
-
29
- try:
30
- choice = input("> ").strip()
31
- except (EOFError, KeyboardInterrupt):
32
- return None
33
-
34
- if choice.lower() == "q":
35
- return None
36
-
37
- try:
38
- idx = int(choice) - 1
39
- if 0 <= idx < len(TOOLS):
40
- return TOOLS[idx].name
41
- except ValueError:
42
- pass
43
-
44
- return None
1
+ import sys
2
+ if sys.platform == "win32":
3
+ sys.stdout.reconfigure(encoding="utf-8")
4
+
5
+ from devtools.tools import TOOLS
6
+ from devtools.__main__ import VERSION
7
+
8
+
9
+ def render_launcher():
10
+ """
11
+ CLI launcher — list all tools with numbers, read selection.
12
+ Returns: tool name string to launch, or None to quit
13
+ """
14
+ if not TOOLS:
15
+ print("No tools registered!")
16
+ return None
17
+
18
+ print()
19
+ print("=" * 50)
20
+ print(f" devtools {VERSION} — 开发者工具箱")
21
+ print("=" * 50)
22
+ print()
23
+ for i, tool in enumerate(TOOLS):
24
+ print(f" {i + 1}. {tool.name:15s} — {tool.description}")
25
+ print()
26
+ print(f" [1-{len(TOOLS)}] 选择工具 | [Q] 退出")
27
+ print()
28
+
29
+ try:
30
+ choice = input("> ").strip()
31
+ except (EOFError, KeyboardInterrupt):
32
+ return None
33
+
34
+ if choice.lower() == "q":
35
+ return None
36
+
37
+ try:
38
+ idx = int(choice) - 1
39
+ if 0 <= idx < len(TOOLS):
40
+ return TOOLS[idx].name
41
+ except ValueError:
42
+ pass
43
+
44
+ return None
@@ -1,29 +1,35 @@
1
- """Tools registry for devtools"""
2
- from devtools.types import Tool
3
-
4
- TOOLS = [
5
- Tool(
6
- name="portkill",
7
- category="进程/端口",
8
- description="按端口杀 Node.js 进程",
9
- module="devtools.tools.portkill",
10
- ),
11
- Tool(
12
- name="removebg",
13
- category="图像处理",
14
- description="批量删除图片背景",
15
- module="devtools.tools.removebg",
16
- ),
17
- Tool(
18
- name="apkpull",
19
- category="设备管理",
20
- description="提取手机 APK 文件",
21
- module="devtools.tools.apkpull",
22
- ),
23
- ]
24
-
25
- def get_tool(name: str):
26
- for tool in TOOLS:
27
- if tool.name == name:
28
- return tool
29
- return None
1
+ """Tools registry for devtools"""
2
+ from devtools.types import Tool
3
+
4
+ TOOLS = [
5
+ Tool(
6
+ name="portkill",
7
+ category="进程/端口",
8
+ description="按端口杀 Node.js 进程",
9
+ module="devtools.tools.portkill",
10
+ ),
11
+ Tool(
12
+ name="removebg",
13
+ category="图像处理",
14
+ description="批量删除图片背景",
15
+ module="devtools.tools.removebg",
16
+ ),
17
+ Tool(
18
+ name="url2md",
19
+ category="网页工具",
20
+ description="将网页链接转换为 Markdown 文件",
21
+ module="devtools.tools.url2md",
22
+ ),
23
+ Tool(
24
+ name="apkpull",
25
+ category="设备管理",
26
+ description="提取手机 APK 文件",
27
+ module="devtools.tools.apkpull",
28
+ ),
29
+ ]
30
+
31
+ def get_tool(name: str):
32
+ for tool in TOOLS:
33
+ if tool.name == name:
34
+ return tool
35
+ return None
@@ -1 +1 @@
1
- """apkpull - Extract APK files from Android device via ADB"""
1
+ """apkpull - Extract APK files from Android device via ADB"""
@@ -1,5 +1,5 @@
1
- from devtools.tools.apkpull.ui import run
2
-
3
- if __name__ == "__main__":
4
- import sys
1
+ from devtools.tools.apkpull.ui import run
2
+
3
+ if __name__ == "__main__":
4
+ import sys
5
5
  run(sys.argv[1:])