Cute Python traceback beautifier with multilingual support
Project description
Kawaii Traceback
一个可爱的Python异常美化工具,提供更友好的错误提示和多语言支持
✨ 特性
- 可爱的异常输出格式
- 智能错误建议(拼写检查、导入提示、Traceback简化等)及可扩展性
- 高度的多语言可扩展性
- 高度可定制的提示信息(甚至可以对自定义场景自定义提示)
- 兼容标准Python traceback模块
📦 安装
pip install kawaii-traceback
🚀 快速开始
import kawaiitb.autoload # noqa
# 现在所有异常都会以可爱的方式显示
1 / 0
🌍 多语言支持
“语言”实际上是广义语言的扩展,你可以通过自定义新的语言来自定义提示的风格
# 加载中文提示
import kawaiitb
kawaiitb.load('zh_hans')
# 或者加载猫娘版提示
kawaiitb.load('neko_zh')
🛠 配置
创建 mytb.json 配置文件:
{
"translate_keys": {
"my_neko": {
"extend": "zh_hans",
"native.ZeroDivisionError.msg": "{divisor}变成零了喵!不能除以零喵不能除以零喵!",
"native.AttributeError.premsg": "{type_} 类型的 '{obj}' 没有属性 '{name}' 喵!"
}
},
"default_lang": "my_neko"
}
然后使用 kawaiitb.load(file='mytb.json') 加载配置。
🤝 贡献
欢迎提交Issue和PR!请确保:
- 开发新功能前请先创建Issue
- 代码需与已有风格一致
- 添加相应的测试用例
📜 许可证
本项目基于MIT许可证。请查看LICENSE文件以获取更多信息。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kawaii_traceback-0.2.1.tar.gz.
File metadata
- Download URL: kawaii_traceback-0.2.1.tar.gz
- Upload date:
- Size: 42.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cffce60ae023c7de1441ed002ae2ddad0a675a1954cf9b4353198202fa0e79b
|
|
| MD5 |
0d6ab6438a8c69a508ee43142c36986d
|
|
| BLAKE2b-256 |
9e32175c74ca6cc24fe6d76ce47756a600479b4854627fd7a91ea407508a9be1
|
Provenance
The following attestation bundles were made for kawaii_traceback-0.2.1.tar.gz:
Publisher:
publish.yml on BPuffer/kawaii-traceback
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kawaii_traceback-0.2.1.tar.gz -
Subject digest:
6cffce60ae023c7de1441ed002ae2ddad0a675a1954cf9b4353198202fa0e79b - Sigstore transparency entry: 518569271
- Sigstore integration time:
-
Permalink:
BPuffer/kawaii-traceback@684d3e2251563c27c3ee012f2bbb9b1b85e811d8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BPuffer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@684d3e2251563c27c3ee012f2bbb9b1b85e811d8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file kawaii_traceback-0.2.1-py3-none-any.whl.
File metadata
- Download URL: kawaii_traceback-0.2.1-py3-none-any.whl
- Upload date:
- Size: 45.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3e03f37081e8e5958b82cc6a16121ed641bb71cbaadb38297b284ae2336daec
|
|
| MD5 |
86e73b4120384da8a56eabf42ea013ff
|
|
| BLAKE2b-256 |
5d8c786744a268792dbd0871d64ebf00b260ab1b585d6d8ac6f23b87daa952ec
|
Provenance
The following attestation bundles were made for kawaii_traceback-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on BPuffer/kawaii-traceback
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kawaii_traceback-0.2.1-py3-none-any.whl -
Subject digest:
b3e03f37081e8e5958b82cc6a16121ed641bb71cbaadb38297b284ae2336daec - Sigstore transparency entry: 518569305
- Sigstore integration time:
-
Permalink:
BPuffer/kawaii-traceback@684d3e2251563c27c3ee012f2bbb9b1b85e811d8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BPuffer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@684d3e2251563c27c3ee012f2bbb9b1b85e811d8 -
Trigger Event:
workflow_dispatch
-
Statement type: