text_discoloration
Colorful terminal output with typewriter effect. Zero dependencies.
Features
Color Output
- 8 classic colors: Red, Green, Yellow, Blue, Purple, Cyan, White, Black
- Direct color printing:
color_print_red("Hello") - Color typewriter effect:
typewriter_blue("Hello", delay=0.05)
Typewriter Effects
- Standard typewriter:
typewriter("text", delay=0.05) - Random color typewriter:
random_typewriter("rainbow text") - Custom color typewriter:
color_typewriter("text", "green")
Status Prompts
info("Loading...")→ Blue [INFO]success("Done!")→ Green [SUCCESS]error("Failed")→ Red [ERROR]warn("Check this")→ Yellow [WARNING]
Utilities
slow_print("slow text", delay=0.05)— Print character by charactercolor_print_red("text")— Print without typewriter effect
Installation
pip install text_discoloration
Update Notice
- Log prompt is disabled by default.
- If you need to enable log prompts, use the example below:
from text_discoloration import set_verbose
set_verbose()
Changelog
[3.2.0] - 2026-05-23
Added
- 新增
download_file()下载文件功能- 支持进度条显示
- 支持自定义请求头(伪装)
- 支持重试机制(默认2次)
- 支持断点续传(自动处理)
- 提供友好的错误提示和建议
- 新增
get_downloads()查询 PyPI 模块下载量- 支持缓存(60秒内重复查询返回缓存结果)
- 支持重试机制
- 新增
ra命令行密钥生成工具- 支持
ra -i 32指定长度 - 支持
ra 1 -i 32关闭数字 - 支持
ra 2关闭小写、ra 3关闭大写、ra 4关闭符号
- 支持
- 新增文件管理 CLI 命令
tcd file read <file>读取文件tcd file write <file> <content>写入文件tcd file append <file> <content>追加内容tcd file edit <file>交互式编辑tcd file hash <file>计算哈希tcd file b64 <file>Base64 编码文件
- 新增
tcd downloads <模块名>查询单个模块下载量 - 新增
tcd downloads-all批量查询预设模块下载量 - 新增
dataclass序列化支持to_json(obj)dataclass → JSON 字符串from_json(cls, json_str)JSON 字符串 → dataclassto_dict(obj)dataclass → 字典from_dict(cls, data)字典 → dataclass- 支持嵌套 dataclass、datetime、date、Enum、list 等类型
Changed
ra_key()函数现支持no_lower和no_upper参数(单独控制大小写)- CLI 命令统一整合,
tcd和ra共享同一个入口 - 下载进度条优化,增加实时速度显示
- 文件管理功能增强,支持更多操作
Security
- 下载功能默认添加 User-Agent 伪装,避免被部分服务器拒绝
- 网络错误时提供清晰的解决建议(DNS、超时、权限等)
[3.1.0] - 2026-05-22
Added
- 新增
disable_log()关闭内部日志输出 - 新增
enable_log()开启内部日志输出 - 新增
_print_error()/_print_warn()用户可见错误提示 - 新增
scan_text_file()对非 Python 文件的安全扫描 - 新增计划(plan)配置管理支持
- 新增
skip_incomplete配置项,允许语法错误只警告不拦截
Changed
- 日志系统重构:
_log_enabled控制内部日志,_quiet控制用户输出 static_scan函数优化:语法错误只警告,不直接拦截separator()在静默模式下输出普通分隔线progress_bar()在静默模式下输出百分比edit_file()在静默模式下限制输出行数(最多50行)spinner和spinner_context合并为工厂函数_create_spinner
Fixed
- 修复
text_discoloration在 Termux 环境下的兼容性问题 - 修复静默模式下
table()忽略 headers 的问题 - 修复
binary_text中globals()查找颜色函数的问题
[3.0.0] - 2026-05-20
Added
- 初始稳定版本
- 彩色终端输出
- 打字机特效
- 状态提示(info/success/error/warn)
- 进度条、表格、树形结构
- 文件读写、哈希计算
- Base64 编解码
- 二进制执行(安全沙箱模式)
- 日志记录器(Logger)
[2.0.0] - 2026-05-10
Added
- 早期版本,基础功能
Metadata
Release files for text-discoloration 3.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| text_discoloration-3.5.1.tar.gz | 24.0 kB | Without provenance | Details for text_discoloration-3.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| text_discoloration-3.5.1-py3-none-any.whl | Python 3 | none | any | Details for text_discoloration-3.5.1-py3-none-any.whl |
Total release size: 46.7 kB
Release files / text_discoloration-3.5.1.tar.gz
| Download URL | text_discoloration-3.5.1.tar.gz |
|---|---|
| Size | 24.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7c98f27ffdcd89de74cf3dd302073b644ddf68b06ef69c9ebf87407bdad6554
|
|
BLAKE2b-256 checksum How to use checksums |
33e5991c6b8a6abb32363049661e91e23030672dbe66bb23a0a3a60f81152e10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / text_discoloration-3.5.1-py3-none-any.whl
| Download URL | text_discoloration-3.5.1-py3-none-any.whl |
|---|---|
| Size | 22.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5436287c1bd709be2095c5d5bb09ba594c9794b97837404af71e6881f683bdea
|
|
BLAKE2b-256 checksum How to use checksums |
c8ee772cde1be7852f429b4fd1d671f536889468d35c2271529c1a309edd8597
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Security for text-discoloration 3.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.