Convert to Comic Book 漫画转转转
一个强大的命令行工具,用于将图片文件夹或压缩包转换为漫画书格式(CBZ、CBR、CB7、CBT)。
特性
- 🔄 多格式支持: 支持文件夹、CBZ、CBR、CB7、CBT、ZIP、RAR、7Z、TAR 之间的相互转换
- 🚀 高性能: 使用异步处理,支持批量转换
- 📦 灵活配置: 支持自动识别资源类型、自定义输入输出流等
- 🛡️ 安全可靠: 完善的错误处理和日志记录
- 🌍 跨平台: 支持 Windows、Linux、macOS
快速开始
安装
# 最小安装(仅支持 ZIP 和 TAR)
pip install ccb-cli
# 或使用标准安装
pip install ccb-cli[standard]
# 完整安装(扩展支持 RAR 和 7Z)
pip install ccb-cli[full]
基本使用
# 转换单个文件夹为 CBZ(-R 转换后删除源目录)
ccb /path/to/single_folder
ccb /path/to/single_folder -R
# 批量转换整个目录下的文件夹为 CBZ(-R 转换后删除叶目录)
ccb -c /path/to/root_folder
ccb -c /path/to/root_folder -R
# 仅转换指定目录下第 1 层的子目录或归档文件
ccb /path/to/root_folder -d 1
# 指定多个 CBZ 转换为文件夹
ccb -f cbz -t folder comic_book1.cbz comic_book2.cbz
# 指定导出路径(-F 强制替换同名文件或目录)
ccb /path/to/source -o /dir/to/output
ccb /path/to/source -o /dir/to/output -F
支持的格式
输入格式
- 文件夹 (folder)
- 漫画书格式: CBZ, CBR, CB7, CBT
- 标准压缩格式: ZIP, RAR, 7Z, TAR
输出格式
- 文件夹 (folder)
- 漫画书格式: CBZ, CBR, CB7, CBT
转换关系
| 输入格式 | 可转换为 |
|---|---|
folder |
cbz, cbr, cb7, cbt |
cbz |
folder, cbr, cb7, cbt |
cbr |
folder, cbz, cb7, cbt |
cb7 |
folder, cbz, cbr, cbt |
cbt |
folder, cbz, cbr, cb7 |
zip |
folder, cbz, cbr, cb7, cbt |
rar |
folder, cbz, cbr, cb7, cbt |
7z |
folder, cbz, cbr, cb7, cbt |
tar |
folder, cbz, cbr, cb7, cbt |
命令行选项
ccb [可选参数] <源列表>
位置参数:
源列表 目录或文件 (支持 cbz, cbr, cb7, cbt, zip, rar, 7z, tar)
选项:
-h, --help 显示帮助信息.
-f, --from-type {auto,folder,cbz,cbr,cb7,cbt,zip,rar,7z,tar}
指定源类型,默认为`auto`
-t, --to-type {folder,cbz,cbr,cb7,cbt}
指定目标类型,默认为`cbz`(与`to-type`类型一致的源将不参与转换)
-o, --output-dir OUTPUT_DIR
重定向导出目录(默认行为是导出到源所在目录)
-c, --collect 搜集源列表中所有的叶文件或不含叶文件的叶目录,并作为新的源列表
-d DEPTH, --depth DEPTH
仅处理从输入路径算起第 DEPTH 层的子目录或归档文件(0=输入路径本身,1=直接子目录,以此类推)
-q, --quiet 静默模式,仅显示错误和摘要信息
-R, --remove 处理完成后删除源列表中所有被转换的源
-F, --force 强制替换同名的文件或目录(默认行为是覆盖)
-v, --version 显示版本信息
特殊行为:如果源类型的from-type与to-type类型一致,则不会对该源进行任何转换或移除处理
许可证
本项目使用 MIT License 开源协议。
文档
Metadata
Release files for ccb-cli 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ccb_cli-2.3.0.tar.gz | 123.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ccb_cli-2.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 140.2 kB
Release files / ccb_cli-2.3.0.tar.gz
| Download URL | ccb_cli-2.3.0.tar.gz |
|---|---|
| Size | 123.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c250f18dcccc3035ec7f62af3e0fcafe80a61016b23c587d30af907438b53c4
|
|
BLAKE2b-256 checksum How to use checksums |
4d599a6dd47525a8cdab89d3af3c38544c14b8e9b096f7e66de476e55a84426f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / ccb_cli-2.3.0-py3-none-any.whl
| Download URL | ccb_cli-2.3.0-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b8e4ceebc2d47dc260be6056e7ed949a74f0c3035dc5881fc66f20546ba30bc
|
|
BLAKE2b-256 checksum How to use checksums |
68df260d668d2dd6b6f6709105b4b48e493ffe253477a239914ce99d2f5653b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency log