Package: comicpy
comicpyTool to create CBR or CBZ files.Extracts images from PDF, ZIP, CBR files, generating comic files respecting their original order.The original files are not altered.ImportantFor full operation ofcomicpywhen using RAR files, you must have available therarcommand, download and install it from the official site,rarlab - rar/unrar command.FeaturesConvertPDFfile toCBRorCBZfiles (by default).ConvertRARfiles toCBRfiles.ConvertZIPfiles toCBZfiles.Scan in given directory and filterPDF,ZIP,RARfiles depending on the given extension, convert them intoCBRorCBZfiles, generating individual files or consolidated into one.Scan in the given directory and filterCBR,CBZfiles allowing to merge them all into one.ExtractCBRorCBZfiles fromRARorZIParchives.Support for password protectedRARorZIParchives.Installationpip install comicpyUsageCLI - usageCommand help.$comicpy-hFile usageCommandDescription--type fFile.-p PATH, --path PATHPath of file.-d DEST, --dest DESTPath to save output files. Default is "."-c {rar,zip}, --compressor {rar,zip}Type of compressor to use.-o OUTPUT, --output OUTPUTPrefix of output file.--checkCheck the CBR or CBZ files created.-u {b,kb,mb,gb}, --unit {b,kb,mb,gb}Unit of measure of data size. Default is "mb".--password PASSWORDPassword of file protected.$comicpy--typef-pfile.PDF--check-ukb
$
$comicpy--typef-pfile.rar--check
$
$comicpy--typef-pfile.zip--check--passwordPASSDirectory usageCommandDescription--type dDirectory.-p PATH, --path PATHPath of directory.--filter {pdf,rar,zip,cbr,cbz}Filter files on directory. Default is "zip".-c {rar,zip}, --compressor {rar,zip}Type of compressor to use. Default is "zip".-d DEST, --dest DESTPath to save output files. Default is ".".-o OUTPUT, --output OUTPUTPrefix of output file. Default is "Converted_".--checkCheck the CBR or CBZ files created.--joinJoin or does not files thath are in the directory. Default is "False".-u {b,kb,mb,gb}, --unit {b,kb,mb,gb}Unit of measure of data size. Default is "mb".--password PASSWORDPassword of file protected.$comicpy--typed-prars_dir--filterrar-crar--check--join-oprefix_final_--passwordPASS
$foriin$(ls-dZip_Dir_*/);do>comicpy--typed-p"$i"--filterzip-czip--check-o${i: 0:-1}--join
>done$Development - usagepath='.'parameter ofComicPy.to_write(), indicates that files will be written by default to the current directory. It can be changed.Single PDF, RAR, ZIP file -> CBZ or CBR>>>fromcomicpyimportComicPy>>>>>>pdf_file='file_pdf.PDF'>>>>>>comic=ComicPy(unit='mb')>>>>>>data=comic.process_pdf(filename=pdf_file,compressor='zip')>>>>>>metaFileCompress=comic.to_write(listCurrentFiles=data)>>>print(metaFileCompress)[{'name':'./file_pdf/file_pdf.cbz','size':'76.63 MB'}]>>>>>>comic.check_integrity(filename=metaFileCompress[0]['name'])Fileisvalid?:"True"True>>>>>>comic.check_integrity(filename=metaFileCompress[0]['name'],show=False)True>>>Directory with PDFs, RARs, ZIPs files -> CBZ or CBRThejoinparameter indicates whether all found files are merged or treated as individual files.Example, directory with RAR files -join=False>>>fromcomicpyimportComicPy>>>>>>dir_RAR='rars'>>>>>>comic=ComicPy(unit='GB')>>>>>>data=comic.process_dir(...filename='final_CBR_file',...directory_path=dir_RAR,...extention_filter='rar',...compressor='rar',...password=None,...join=False...)>>>metaFileCompress=comic.to_write(listCurrentFiles=data)>>>print(metaFileCompress)[{'name':'./final_CBR_file/chapter_1.cbr','size':'0.02 GB'},{'name':'./final_CBR_file/chapter_2.cbr','size':'0.01 GB'}]>>>>>>>foriteminmetaFileCompress:...comic.check_integrity(...filename=item['name'],...show=True...)...Fileisvalid?:"True"TrueFileisvalid?:"True"TrueFileisvalid?:"True"TrueFileisvalid?:"True"True>>>Example, directory with RAR files -join=True>>>fromcomicpyimportComicPy>>>>>>dir_RAR='rars'>>>>>>comic=ComicPy(unit='GB')>>>>>>data=comic.process_dir(...filename='final_CBR_file',...directory_path=dir_RAR,...extention_filter='rar',...compressor='rar',...password=None,...join=True...)>>>metaFileCompress=comic.to_write(listCurrentFiles=data)>>>print(metaFileCompress)[{'name':'result/final_CBR_file/final_CBR_file.cbr','size':'0.05 GB'}]>>>>>>foriteminmetaFileCompress:...comic.check_integrity(...filename=item['name'],...show=True...)...Fileisvalid?:"True"True>>>