abtbb 0.0.1__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.
abt/__init__.py ADDED
@@ -0,0 +1 @@
1
+ # -*- coding:UTF-8 -*-
abt/py.typed ADDED
File without changes
abt/utils/__init__.py ADDED
@@ -0,0 +1 @@
1
+ # -*- coding:UTF-8 -*-
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.5
2
+ Name: abtbb
3
+ Version: 0.0.1
4
+ Summary: abt:一个自己也能读懂、自己也能维护的 Python 底层工具包
5
+ Project-URL: Homepage, https://github.com/yanyue/abt
6
+ Author: yayo
7
+ License: MIT
8
+ License-File: LICENSE
9
+ Keywords: library,toolkit,utility
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.7
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.7
20
+ Requires-Dist: typing-extensions<4.8,>=4.0; python_version < '3.8'
21
+ Requires-Dist: typing-extensions>=4.0; python_version >= '3.8'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # abt
25
+
26
+ > 一个自己也能读懂、自己也能维护的 Python 底层工具包。
27
+
28
+ ## 这是什么
29
+
30
+ `abt` 是对既有工具包 `apiboot` 的**从零重写**。
31
+
32
+ `apiboot` 的功能是 OK 的,但它几乎全部由 AI 生成:代码量涨得很快,却没有一个字是「自己先想清楚再落笔」的。结果是大量冗余封装、过度抽象,作者本人也读不懂——下游项目一旦出问题,除了「再问一次 AI」没有第二条路。
33
+
34
+ `abt` 重写它,**验收标准不是功能跑通,而是作者本人能在不询问任何 AI 的情况下,读懂并定位任意一个函数的实现与问题。**
35
+
36
+ ## 两条硬规则
37
+
38
+ 1. **不包装 stdlib**。`pathlib` / `datetime` / `json` 能直接用就直接用,只在语义上做了收敛或增强时才封装。
39
+ 2. **一次只做一个模块**。每个函数要能一句话说清,docstring 写「为什么」和「不变量」,不写「做了什么」。
40
+
41
+ ## 特色:第三方依赖全部懒加载
42
+
43
+ `abt` 的**运行时第三方依赖为零**。
44
+
45
+ ```bash
46
+ pip install abt # 不会顺带装 requests / sqlalchemy / redis
47
+ ```
48
+
49
+ - `import abt` 和 `import abt.<任意子模块>` **绝不会**因为环境里缺某个第三方包而报错。
50
+ - 只有真正**调用到**用到它的那个函数时才会失败,报错信息里会写清楚缺哪个包、为什么要装它、`pip install` 命令是什么。
51
+
52
+ 换句话说,装了不炸;缺依赖在调用点才暴露,而不是在 import 阶段就让整个服务起不来。
53
+
54
+ ## 运行环境
55
+
56
+ - **Python 3.7+**(最低 3.7;开发环境 3.11)
57
+ - 3.7 的语法下限由 `vermin` 把关:`uv run vermin --target=3.7- --violations abt/` 必须始终通过
58
+
59
+ ## 设计文档
60
+
61
+ 完整的出发点、验收标准、`apiboot` 模块构成、已知坑位清单、重写路线图,都在 [CLAUDE.md](CLAUDE.md) 里。
62
+
63
+ ## 安装
64
+
65
+ ```bash
66
+ uv add abtbb
67
+ ```
68
+
69
+ ```python
70
+ from abt import logger
71
+ ```
72
+
73
+ > **发布名 ≠ import 名。** PyPI 上的 `abt` 已被他人占用,所以发布名用 `abtbb`;但 import 名仍是 `abt`——它由包目录名决定,跟发布名无关。
74
+ > (`pip install pillow` → `import PIL` 同理。)
75
+
76
+ 本地开发:
77
+
78
+ ```bash
79
+ uv sync # 装依赖(含 dev group:pytest / mypy / ruff / vermin)
80
+ uv run pytest # 跑测试
81
+ uv run mypy abt # 静态检查
82
+ uv run ruff check .
83
+ uv run vermin --target=3.7- --violations abt/ # Python 3.7 语法下限闸门
84
+ ```
85
+
86
+ ## 命令行
87
+
88
+ ```bash
89
+ abtrun --help
90
+ ```
91
+
92
+ > 命令名用 `abtrun` 而非 `abt`——`abt` 已被 `apiboot` 的 CLI 占用,两个包共存时会互相覆盖 PATH。
93
+
94
+ ## 发布到 PyPI
95
+
96
+ ```bash
97
+ uv sync # 装齐工具链(含 twine)
98
+ python scripts/upload_pypi.py # 构建 + 输入 token + 确认上传
99
+ python scripts/upload_pypi.py --dry-run # 只构建, 不上传, 不用输 token
100
+ python scripts/upload_pypi.py --repository testpypi # 先发测试仓库试水
101
+ ```
102
+
103
+ 流程:清理旧 `dist/` → 重新构建 sdist + wheel → 预检版本号是否已存在 → 提示输入 PyPI API Token(输入不回显,不落盘不进 shell history)→ 询问 `y/n` 确认 → 上传。
104
+
105
+ Token 申请:<https://pypi.org/manage/account/token/>,用户名固定 `__token__`。
106
+
107
+ > 同一版本号不能重复发布,报错前请把 `pyproject.toml` 里的 `version` 改大一位。
108
+
109
+ ## License
110
+
111
+ MIT
@@ -0,0 +1,8 @@
1
+ abt/__init__.py,sha256=YNz7Q28dOfKaQaH-o3INsqQKz_saZMWlozG0SWmCFTk,23
2
+ abt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ abt/utils/__init__.py,sha256=YNz7Q28dOfKaQaH-o3INsqQKz_saZMWlozG0SWmCFTk,23
4
+ abtbb-0.0.1.dist-info/METADATA,sha256=MlTdHLTpBSr2dl3yXcBRGvb-s4bA3CHE0ifP2TjtYjU,4311
5
+ abtbb-0.0.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
6
+ abtbb-0.0.1.dist-info/entry_points.txt,sha256=04GJdWX_JIixiLmdu-IX1heRd2zV0T_s0Qiht9V0r2g,40
7
+ abtbb-0.0.1.dist-info/licenses/LICENSE,sha256=RQHSR72-YFlBW8ikm6xPXGR_BXpHMq6PmfhqRPW_Fw4,1061
8
+ abtbb-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ abtrun = abt.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yayo
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.