CBR libraries
A CBR is a RAR archive. RAR compression is proprietary: there are open-source decoders, but no open-source library can create RAR files. To change a CBR (add metadata, fix page order), read it with one of these libraries and write a CBZ. Check whether a library reads RAR5 (WinRAR 5+ default) as well as the older RAR4. For general RAR information see the RAR page.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | UnRAR | yes | no | RARLAB reference code; freeware license, not OSI |
| C/C++ | libarchive | yes | no | RAR4 and RAR5, same API as ZIP/7z/TAR |
| C# | SharpCompress | yes | no | pure managed, RAR4 and RAR5 |
| Java | junrar | yes | no | pure Java, RAR4 only (no RAR5); UnRAR license |
| Go | rardecode | yes | no | pure Go, RAR4 and RAR5, fs.FS |
| Go | archives | yes | no | mholt/archives: one API for RAR, ZIP, 7z, TAR |
| Python | rarfile | yes | no | zipfile-like API; needs the unrar tool |
| Python | comicbox | yes | converts to CBZ | comic-specific metadata, pages, covers |
| Ruby | ffi-libarchive | yes | no | libarchive binding |
| Rust | unrar | yes | no | binding to RARLAB UnRAR |
| Rust | compress-tools | yes | no | libarchive binding |
PHP has no maintained open-source RAR reader: the PECL rar extension had its last release in 2020. Convert CBR to CBZ with a command-line tool and use ZipArchive.
By language#
- CBR libraries for C/C++ Open-source C/C++ libraries to read CBR (RAR) comic book archives: RARLAB's UnRAR and libarchive. Page order, cover, ComicInfo.xml and converting CBR to CBZ.
- CBR libraries for C# Open-source .NET library to read CBR (RAR) comic book archives: SharpCompress. Page order, cover, ComicInfo.xml and converting CBR to CBZ in C#.
- CBR libraries for Java Open-source Java library to read CBR (RAR) comic book archives: junrar. Page order, cover, ComicInfo.xml and converting CBR to CBZ in Java.
- CBR libraries for Go Open-source Go libraries to read CBR (RAR) comic book archives: nwaples/rardecode and mholt/archives. Pure Go, RAR4 and RAR5, page order, cover.
- CBR libraries for Python Open-source Python libraries to read CBR (RAR) comic book archives: rarfile and comicbox. Page order, cover, ComicInfo.xml and converting CBR to CBZ in Python.
- CBR libraries for Ruby Open-source Ruby library to read CBR (RAR) comic book archives: ffi-libarchive. Page order, cover, ComicInfo.xml and converting CBR to CBZ in Ruby.
- CBR libraries for Rust Open-source Rust libraries to read CBR (RAR) comic book archives: the unrar crate and compress-tools. Page order, cover, ComicInfo.xml.