Cute Python traceback beautifier with multilingual support
Project description
Kawaii Traceback
一个可爱的Python异常美化工具,提供更友好的错误提示和多语言支持。
✨ 特性
- 可爱的异常输出格式
- 智能错误建议(拼写检查、导入提示等)及可扩展性
- 多语言支持(英语、简体中文等)及可扩展性
- 可定制的主题和样式
- 兼容标准Python traceback模块
📦 安装
pip install kawaii-traceback
🚀 快速开始
import tools
import kawaiitb;
tools.load('neko_zh') # 加载猫娘配置
# 现在所有异常都会以可爱的方式显示
2 / 0
🌍 多语言支持
“语言”实际上是广义语言的扩展,你可以通过自定义新的语言来自定义提示的风格
# 加载中文提示
import tools
tools.load('zh_hans')
# 或者加载猫娘版提示
tools.load('neko_zh')
🛠 配置
创建 mytb.json 配置文件:
{
"translate_keys": {
"my_neko": {
"extend": "zh_hans",
"native.ZeroDivisionError.msg": "{divisor}变成零了喵!不能除以零喵不能除以零喵!",
"native.NameError.msg": "你确定{name}存在喵?"
}
},
"default_lang": "my_neko"
}
然后使用 kawaiitb.load(file='mytb.json') 加载配置。
🤝 贡献
欢迎提交Issue和PR!请确保:
- 代码需与已有风格一致
- 添加相应的测试用例
📜 许可证
本项目基于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.1.1.tar.gz.
File metadata
- Download URL: kawaii_traceback-0.1.1.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68806028e6207af8ee5fc177b7515126656d355381f63a7656441d9e276565e0
|
|
| MD5 |
a4488b0ff991fb3abf3130f8d1ac07c8
|
|
| BLAKE2b-256 |
e29a72f8f55c6a8f37f823f7bc35ae5dfc64ea202d8af6d83d220be809cca309
|
Provenance
The following attestation bundles were made for kawaii_traceback-0.1.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.1.1.tar.gz -
Subject digest:
68806028e6207af8ee5fc177b7515126656d355381f63a7656441d9e276565e0 - Sigstore transparency entry: 220036483
- Sigstore integration time:
-
Permalink:
BPuffer/kawaii-traceback@22d8cf90dbe41d489f55d8c9a7f88ff3326101cb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BPuffer
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@22d8cf90dbe41d489f55d8c9a7f88ff3326101cb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file kawaii_traceback-0.1.1-py3-none-any.whl.
File metadata
- Download URL: kawaii_traceback-0.1.1-py3-none-any.whl
- Upload date:
- Size: 39.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
284c904ac034e1b0d474e7586093a734904bca2a2589f665f11aede2de4ddd66
|
|
| MD5 |
83dea51458a86dfb9dad31b2c74b427a
|
|
| BLAKE2b-256 |
6e786c1db2a635bd5fd9d8b3b20cafaba292bf467697b62f4de27a64eca544f2
|
Provenance
The following attestation bundles were made for kawaii_traceback-0.1.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.1.1-py3-none-any.whl -
Subject digest:
284c904ac034e1b0d474e7586093a734904bca2a2589f665f11aede2de4ddd66 - Sigstore transparency entry: 220036485
- Sigstore integration time:
-
Permalink:
BPuffer/kawaii-traceback@22d8cf90dbe41d489f55d8c9a7f88ff3326101cb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BPuffer
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@22d8cf90dbe41d489f55d8c9a7f88ff3326101cb -
Trigger Event:
workflow_dispatch
-
Statement type: