{"id":13961390,"url":"https://github.com/raul23/pyebooktools","last_synced_at":"2025-04-10T10:43:27.014Z","repository":{"id":37266978,"uuid":"129934511","full_name":"raul23/pyebooktools","owner":"raul23","description":"Command-line program for organizing and managing ebook collections. It is a Python port from the original shell scripts ebook-tools ","archived":false,"fork":false,"pushed_at":"2024-05-05T04:34:59.000Z","size":1094,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-09-29T09:15:32.531Z","etag":null,"topics":["calibre","command-line","ebook","ebook-manager","python","python-port"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raul23.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-17T16:30:57.000Z","updated_at":"2024-09-17T18:58:19.000Z","dependencies_parsed_at":"2024-04-14T21:44:04.900Z","dependency_job_id":"5018e008-f33a-46ab-80c6-fd2889c64248","html_url":"https://github.com/raul23/pyebooktools","commit_stats":null,"previous_names":["raul23/py-ebooktools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raul23%2Fpyebooktools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raul23%2Fpyebooktools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raul23%2Fpyebooktools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raul23%2Fpyebooktools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raul23","download_url":"https://codeload.github.com/raul23/pyebooktools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248200208,"owners_count":21063851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calibre","command-line","ebook","ebook-manager","python","python-port"],"created_at":"2024-08-08T17:01:06.219Z","updated_at":"2025-04-10T10:43:26.996Z","avatar_url":"https://github.com/raul23.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":".. raw:: html\n\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/raul23/pyebooktools/master/docs/logo/pyebooktools.png\"\u003e\n    \u003cbr\u003e 🚧 \u0026nbsp;\u0026nbsp;\u0026nbsp;\u003cb\u003eWork-In-Progress\u003c/b\u003e\n  \u003c/p\u003e\n\nThis project (**version 0.1.0a3**) is a Python port of `ebook-tools`_ which is\nwritten in Shell by `na--`_. The Python script `ebooktools.py`_ is a collection\nof tools for automated organization and management of large ebook collections.\n\nCheck also my other project `search-ebooks`_ which is based on `pyebooktools`_\nfor searching through the content and metadata of ebooks.\n\n`:warning:`\n\n  Check `organize-ebooks \u003chttps://github.com/raul23/organize-ebooks\u003e`_ which is the Python port of `organize-ebooks.sh \n  \u003chttps://github.com/na--/ebook-tools/blob/master/organize-ebooks.sh\u003e`_ and includes a `Docker image \n  \u003chttps://hub.docker.com/repository/docker/raul23/organize/general\u003e`_ for easy installation of all needed dependencies and Python package.\n   \nAbout\n=====\nThe `ebooktools.py`_ script is a Python port of the `shell scripts`_ from\n`ebook-tools`_ and makes use of the following modules:\n\n- ``edit_config.py`` edits a configuration file which can either be the main\n  config file that contains all the options defined\n  `below \u003c#usage-options-and-configuration\u003e`__ or the logging config file whose\n  default values is defined in `default_logging.py`_. The `edit`_ subcommand\n  from the ``ebooktools.py`` script uses this module.\n- ``convert_to_txt.py`` converts the supplied file to a text file. It can\n  optionally also use *OCR* for ``.pdf``, ``.djvu`` and image files. The\n  `convert`_ subcommand from the ``ebooktools.py`` script uses this module.\n- ``find_isbns.py`` tries to find `valid ISBNs`_ inside a file or in a\n  ``string`` if no file was specified. Searching for ISBNs in files uses\n  progressively more resource-intensive methods until some ISBNs are found, for\n  more details see\n  \n  - the `documentation for ebook-tools`_ (shell scripts) or\n  - `search_file_for_isbns()`_ from ``lib.py`` (Python function where ISBNs\n    search in files is implemented).\n  \n  The `find`_ subcommand from the ``ebooktools.py`` script uses this module.\n- ``organize_ebooks.py`` is used to automatically organize folders with\n  potentially huge amounts of unorganized ebooks. This is done by renaming\n  the files with proper names and moving them to other folders:\n  \n    * By default it `searches`_ the supplied ebook files for `ISBNs`_,\n      downloads the book metadata (author, title, series, publication date,\n      etc.) from online sources like Goodreads, Amazon and Google Books and\n      renames the files according to a specified template.\n    * If no ISBN is found, the script can optionally search for the ebooks\n      online by their title and author, which are extracted from the filename\n      or file metadata.\n    * Optionally an additional file that contains all the gathered ebook\n      metadata can be saved together with the renamed book so it can later\n      be used for additional verification, indexing or processing.\n    * Most ebook types are supported: ``.epub``, ``.mobi``, ``.azw``,\n      ``.pdf``, ``.djvu``, ``.chm``, ``.cbr``, ``.cbz``, ``.txt``, ``.lit``,\n      ``.rtf``, ``.doc``, ``.docx``, ``.pdb``, ``.html``, ``.fb2``, ``.lrf``, \n      ``.odt``, ``.prc`` and potentially others. Even compressed ebooks in \n      arbitrary archive files are supported. For example a ``.zip``, ``.rar`` \n      or other archive file that contains the ``.pdf`` or ``.html`` chapters \n      of an ebook can be organized without a problem.\n    * Optical character recognition (`OCR [Wikipedia]\n      \u003chttps://en.wikipedia.org/wiki/Optical_character_recognition\u003e`_) can be\n      automatically used for ``.pdf``, ``.djvu`` and image files when no ISBNs \n      were found in them by the fast and straightforward conversion to \n      ``.txt``. This is very useful for scanned ebooks that only contain\n      images or were badly OCR-ed in the first place.\n    * Files are checked for corruption (zero-filled files, broken pdfs,\n      corrupt archive, etc.) and corrupt files can optionally be moved to\n      another folder.\n    * Non-ebook documents, pamphlets and pamphlet-like documents like saved\n      webpages, short pdfs, etc. can also be detected and optionally moved to\n      another folder.\n      \n    **Ref.:** [ORG]_\n      \n  The `organize`_ subcommand from the ``ebooktools.py`` script uses this\n  module.\n  \n- ``rename_calibre_library.py`` traverses a calibre library folder, renames\n  all the book files in it by reading their metadata from calibre's\n  ``metadata.opf`` files. Then the book files are either moved or symlinked\n  to an output folder along with their corresponding metadata files.\n  The `rename`_ subcommand from the ``ebooktools.py`` script uses this module.\n- ``split_into_folders.py`` splits the supplied ebook files (and the\n  accompanying metadata files if present) into folders with consecutive names\n  that each contain the specified number of files. The `split`_ subcommand\n  from the ``ebooktools.py`` script uses this module.\n\nThus, you have access to various `subcommands`_ from within the\n``ebooktools.py`` script.\n\n`:star:`\n\n  * `ebook-tools`_ is the **original** Shell project I ported to Python. I \n    used the same names for the script options (short and longer versions) so\n    that if you used the shell scripts, you will easily know how to run the\n    corresponding `subcommand`_ with the given options.\n  * `ebooktools.py`_ is the name of the Python script which will always be\n    referred that way in this document (i.e. no hyphen and ending with ``.py``)\n    to distinguish from the original Shell project ``ebook-tools``.\n  * `pyebooktools`_ is the name of the Python package that you need to\n    `install \u003c#install-pyebooktools\u003e`__ to have access to the ``ebooktools.py``\n    script.\n\nInstallation and dependencies\n=============================\nTo install the script ``ebooktools.py``, follow these steps:\n\n1. Install the dependencies `below \u003c#other-dependencies\u003e`__. \n2. Install the ``pyebooktools`` package `below \u003c#install-pyebooktools\u003e`__.\n\nPython dependencies\n-------------------\n* **Platforms:** macOS [soon linux]\n* **Python**: \u003e= 3.6\n* ``lxml`` \u003e= 4.4 for parsing Calibre's ``metadata.opf`` files.\n\n`:information_source:`\n\n  When installing the ``pyebooktools`` package \n  `below \u003c#install-pyebooktools\u003e`__, the ``lxml`` library is automatically \n  installed if it is not found or upgraded to the correct supported version.\n\nOther dependencies\n--------------------\nAs explained in the documentation for `ebook-tools \n\u003chttps://github.com/na--/ebook-tools#shell-scripts\u003e`__, you need recent\nversions of:\n\n  * `calibre`_ for fetching metadata from online sources, conversion to txt\n    (for ISBN searching) and ebook metadata extraction. Versions **2.84** and\n    above are preferred because of their ability to manually specify from which\n    specific online source we want to fetch metadata. For earlier versions you\n    have to set ``isbn_metadata_fetch_order`` and\n    ``organize_without_isbn_sources`` to empty strings.\n  * `p7zip`_ for ISBN searching in ebooks that are in archives.\n  * `Tesseract`_ for running OCR on books - version 4 gives better results even\n    though it's still in alpha. OCR is disabled by default and another engine\n    can be configured if preferred.\n  * **Optionally** `poppler`_, `catdoc`_ and `DjVuLibre`_ can be installed for\n    faster than calibre's conversion of ``.pdf``, ``.doc`` and ``.djvu`` files\n    respectively to ``.txt``.\n    \n    `:warning:`\n    \n       On macOS, you don't need `catdoc`_ since it has the built-in `textutil`_\n       command-line tool that converts any ``txt``, ``html``, ``rtf``, \n       ``rtfd``, ``doc``, ``docx``, ``wordml``, ``odt``, or ``webarchive`` file.\n    \n  * **Optionally** the `Goodreads`_ and `WorldCat xISBN`_ calibre plugins can\n    be installed for better metadata fetching.\n\n|\n\n`:star:`\n\n  If you only install **calibre** among these dependencies, you can still have\n  a functioning program that will organize and manage your ebook\n  collections: \n  \n  * fetching metadata from online sources will work: by `default \n    \u003chttps://manual.calibre-ebook.com/generated/en/fetch-ebook-metadata.html#\n    cmdoption-fetch-ebook-metadata-allowed-plugin\u003e`__\n    **calibre** comes with Amazon and Google sources among others\n  * conversion to txt will work: `calibre`'s own `ebook-convert`_ tool\n    will be used\n    \n  All `subcommands`_ should work but accuracy and performance will be\n  affected as explained in the list of dependencies above.\n\nInstall ``pyebooktools``\n-------------------------\n1. Install first the `Python dependencies \u003c#python-dependencies\u003e`_ and other `tools \u003c#other-dependencies\u003e`_.\n\n2. It is highly recommended to install the ``pyebooktools`` package in a\n   virtual environment using for example `venv`_ or `conda`_.\n\n3. Make sure to update *pip*::\n\n   $ pip install --upgrade pip\n\n4. Install the ``pyebooktools`` package (**bleeding-edge version**) with\n   *pip*::\n\n   $ pip install git+https://github.com/raul23/pyebooktools#egg=pyebooktools\n\n`:warning:`\n\n   Make sure that *pip* is working with the correct Python version. It might be\n   the case that *pip* is using Python 2.x You can find what Python version\n   *pip* uses with the following::\n\n      $ pip -V\n\n   If *pip* is working with the wrong Python version, then try to use *pip3*\n   which works with Python 3.x\n   \n**Test installation**\n\n1. Test your installation by importing ``pyebooktools`` and printing its\n   version::\n\n   $ python -c \"import pyebooktools; print(pyebooktools.__version__)\"\n\n2. You can also test that you have access to the ``ebooktools.py`` script by\n   showing the program's version::\n\n   $ ebooktools --version\n\nUsage, options and configuration\n================================\nAll of the options documented below can either be passed to the\n`ebooktools.py`_ script via command-line arguments or via the configuration\nfile ``config.py`` which is created along with the logging config file\n``logging.py`` when the ``ebooktools.py`` script is run the first time with any\nof the subcommands defined `below`_. The default values for these config files\nare taken from `default_config.py`_ and `default_logging.py`_, respectively.\n\nIn order to use the parameters found in the configuration file ``config.py``, \nuse the `--use-config`_ flag. Hence, you don't need to specify a long command-line\nin the terminal by using this flag. See the `edit`_ subcommand to know how to\nedit this configuration file.\n\nMost arguments are not required and if nothing is specified, the default values\ndefined in the default config file ``default_config.py`` will be used.\n\nThe ``ebooktools.py`` script consists of various subcommands for the\norganization and management of ebook collections. The usage pattern for running\none of the subcommands is as followed:\n\n.. code-block:: terminal\n\n  ebooktools {edit,convert,find,organize,rename,split} [OPTIONS]\n  \nwhere ``[OPTIONS]`` includes general options (as defined in the\n`General options \u003c#general-options\u003e`__ section) and options specific to the \nsubcommand (as defined in the `Script usage, subcommands and options`_ section).\n\n`:warning:`\n \n   In order to avoid data loss, use the `--dry-run`_ or `--symlink-only`_\n   option when running some of the subcommands (e.g. ``rename`` and ``split``)\n   to make sure that they would do what you expect them to do, as explained in\n   the `Security and safety`_ section.\n\nGeneral options\n---------------\nMost of these options are part of the common library `lib.py`_ and may affect\nsome or all of the subcommands.\n\nGeneral control flags\n^^^^^^^^^^^^^^^^^^^^^\n* ``-h``, ``--help``; no config variable; default value ``False``\n\n  Show the help message and exit.\n\n* ``-v``, ``--version``; no config variable; default value ``False``\n\n  Show program's version number and exit.\n\n.. _quiet-label:\n\n* ``-q``, ``--quiet``; config variable ``quiet``; default value ``False``\n\n  Enable quiet mode, i.e. nothing will be printed.\n\n.. _verbose-label:\n\n* ``--verbose``; config variable ``verbose``; default value ``False``\n\n  Print various debugging information, e.g. print traceback when there is an\n  exception.\n  \n.. _use-config-label:\n\n* ``-u``, ``--use-config``; no config variable; default value ``False``\n\n  If this is enabled, the parameters found in the main config file `config.py`_ \n  will be used instead of the command-line arguments. \n  \n  `:information_source:`\n  \n    Note that any other command-line argument that you use in the terminal with \n    the ``--use-config`` flag is ignored, i.e. only the parameters defined in \n    the main config file `config.py`_ will be used.\n\n.. _dry-run-label:\n\n* ``-d``, ``--dry-run``; config variable ``dry_run``; default value ``False``\n\n  If this is enabled, no file rename/move/symlink/etc. operations will actually\n  be executed.\n\n.. _symlink-only-label:\n\n* ``--sl``, ``--symlink-only``; config variable ``symlink_only``; default value\n  ``False``\n  \n  Instead of moving the ebook files, create symbolic links to them.\n\n.. _keep-metadata-label:\n\n* ``--km``, ``--keep-metadata``; config variable ``keep_metadata``; default\n  value ``False``\n  \n  Do not delete the gathered metadata for the organized ebooks, instead save it\n  in an accompanying file together with each renamed book. It is very useful\n  or for additional verification, indexing or processing at a later date. [KM]_\n  \n  .. TODO\n  .. for semi-automatic verification of the organized files with `interactive_organizer.py`_\n\nScript usage, subcommands and options\n-------------------------------------\nThe usage pattern for running a given **subcommand** is the following:\n\n.. code-block:: terminal\n\n  ebooktools {edit,convert,find,organize,rename,split} [OPTIONS]\n  \nwhere ``[OPTIONS]`` includes `general options \u003c#general-options\u003e`__ and \noptions specific to the subcommand as shown below.\n\n`:information_source:`\n\n  Don't forget the name of the Python script ``ebooktools`` before the\n  subcommand.\n\nAll subcommands are affected by the following global options:\n\n* `-h, --help`_\n* `-q, --quiet`_\n* `-v, --verbose`_\n* `-u, --use-config`_\n* `--log-level`_\n* `--log-format`_\n\nThe `-h, --help`_ option can be applied specifically to each subcommand or\nto the  ``ebooktools.py`` script (when called without the subcommand). Thus\nwhen you want the help message for a specific subcommand, you do:\n\n.. code-block:: terminal\n\n  ebooktools {edit,convert,find,split} -h\n \nwhich will show you the options that affect the choosen subcommand. \n\n|\n\nAnd if you want the help message for the whole ``ebooktools.py`` script:\n\n.. code-block:: terminal\n\n  ebooktools -h\n  \nwhich will show you the project description and description\nof each subcommand without showing the subcommand options.\n\nExamples\n========\nMore examples can be found at `examples.rst`_.\n\nExample 1: convert a pdf file to text **with** OCR\n--------------------------------------------------\nTo convert a pdf file to text **with OCR**:\n\n.. code-block:: terminal\n\n   $ ebooktools convert --ocr always -o converted.txt pdf_to_convert.pdf\n   \nBy setting `--ocr`_ to ``always``, the pdf file will be first OCRed before\ntrying the simple conversion tools (``pdftotext`` or calibre's \n``ebook-convert`` if the former command is not found).\n\n.. code-block:: terminal\n\n   Running pyebooktools v0.1.0a3\n   Verbose option disabled\n   OCR=always, first try OCR then conversion\n   Will run OCR on file 'pdf_to_convert.pdf' with 1 page...\n   OCR successful!\n\nExample 2: find ISBNs in a pdf file\n-----------------------------------\nFind ISBNs in a pdf file:\n\n.. code-block:: terminal\n\n   $ ebooktools find pdf_file.pdf\n\n**Output:**\n\n.. code-block:: terminal\n\n   Running pyebooktools v0.1.0a3\n   Verbose option disabled\n   Searching file 'pdf_file.pdf' for ISBN numbers...\n   Extracted ISBNs:\n   9789580158448\n   1000100111\n\nThe search for ISBNs starts in the first pages of the document to increase\nthe likelihood that the first extracted ISBN is the correct one. Then the\nlast pages are analyzed in reverse. Finally, the rest of the pages are\nsearched.\n\nThus, in this example, the first extracted ISBN is the correct one\nassociated with the book since it was found in the first page. \n\nThe last sequence ``1000100111`` was found in the middle of the document\nand is not an ISBN even though it is a technically valid but wrong ISBN\nthat the regular expression `isbn_blacklist_regex`_ didn't catch. Maybe\nit is a binary sequence that is part of a problem in a book about digital\nsystem. \n\nUninstall\n=========\nTo uninstall the `pyebooktools`_ package::\n\n   $ pip uninstall pyebooktools\n   \n`:information_source:`\n\n   When uninstalling the ``pyebooktools`` package, you might be informed\n   that the configuration files *logging.py* and *config.py* won't be\n   removed by *pip*. You can remove those files manually by noting their paths\n   returned by *pip*. Or you can leave them so your saved settings can be\n   re-used the next time you re-install the package.\n\n   **Example:** uninstall the package and remove the config files\n\n   .. code-block:: console\n\n      $ pip uninstall pyebooktools\n      Found existing installation: pyebooktools 0.1.0a3\n      Uninstalling pyebooktools-0.1.0a3:\n        Would remove:\n          /Users/test/miniconda3/envs/ebooktools_py37/bin/ebooktools\n          /Users/test/miniconda3/envs/ebooktools_py37/lib/python3.7/site-packages/pyebooktools-0.1.0a3.dist-info/*\n          /Users/test/miniconda3/envs/ebooktools_py37/lib/python3.7/site-packages/pyebooktools/*\n        Would not remove (might be manually added):\n          /Users/test/miniconda3/envs/ebooktools_py37/lib/python3.7/site-packages/pyebooktools/configs/config.py\n          /Users/test/miniconda3/envs/ebooktools_py37/lib/python3.7/site-packages/pyebooktools/configs/logging.py\n      Proceed (y/n)? y\n        Successfully uninstalled pyebooktools-0.1.0a3\n      $ rm -r /Users/test/miniconda3/envs/ebooktools_py37/lib/python3.7/site-packages/pyebooktools/\n\nLimitations\n===========\nSame `limitations`_ as for ``ebook-tools`` apply to this project too:\n\n  * Automatic organization can be slow - all the scripts are synchronous\n    and single-threaded and metadata lookup by ISBN is not done\n    concurrently. This is intentional so that the execution can be easily\n    traced and so that the online services are not hammered by requests.\n    If you want to optimize the performance, run multiple copies of the\n    script **on different folders**.\n    \n  * The default setting for `isbn_metadata_fetch_order`_ includes two\n    non-standard metadata sources: Goodreads and WorldCat xISBN. For\n    best results, install the plugins (`1`_, `2`_) for them in calibre and\n    fine-tune the settings for metadata sources in the calibre GUI.\n\nSecurity and safety\n===================\nImportant security and safety tips from the `ebook-tools documentation`_:\n\n  Please keep in mind that this is beta-quality software. To avoid data loss,\n  make sure that you have a backup of any files you want to organize. You may\n  also want to run the scripts with the `--dry-run`_ or `--symlink-only`_\n  option the first time to make sure that they would do what you expect them to\n  do.\n  \n  Also keep in mind that these shell scripts parse and extract complex\n  arbitrary media and archive files and pass them to other external programs\n  written in memory-unsafe languages. This is not very safe and\n  specially-crafted malicious ebook files can probably compromise your system\n  when you use these scripts. If you are cautious and want to organize\n  untrusted or unknown ebook files, use something like `QubesOS`_ or at least\n  do it in a separate VM/jail/container/etc.\n\n**NOTE:** ``--dry-run`` and ``--symlink-only`` can be applied to the following\nsubcommands:\n\n.. TODO\n.. `interact`_\n* `organize`_\n* `rename`_\n* `split`_: only ``--dry-run`` is applicable\n\nRoadmap\n=======\nStarting from first priority tasks\n\nShort-term\n----------\n1. Port all `ebook-tools`_ shell scripts into Python\n\n   - |ss| ``organize-ebooks.sh`` |se|: **done**, *see* `organize_ebooks.py`_\n   - ``interactive-organizer.sh``\n   - |ss| ``find-isbns.sh`` |se|: **done**, *see* `find_isbns.py`_\n   - |ss| ``convert-to-txt.sh`` |se|: **done**, *see* `convert_to_txt.py`_\n   - |ss| ``rename-calibre-library.sh`` |se|: **done**, *see* `rename_calibre_library.py`_\n   - |ss| ``split-into-folders.sh`` |se|: **done**, *see* `split_into_folders.py`_\n\n   **Status:** only ``interactive-organizer.sh`` remaining, will port later\n\n2. Add `cache`_ support when converting files to txt\n\n   **Status:** working on it since it is also needed for my other project\n   `search-ebooks \u003chttps://github.com/raul23/search-ebooks#cache\u003e`__ \n   which makes heavy use of `pyebooktools`_\n   \n3. Test on linux\n4. Create a `docker`_ image for this project\n\nMedium-term\n-----------\n1. Add tests on `Travis CI`_\n\n2. Eventually add documentation on `Read the Docs`_\n3. Add a ``fix`` subcommand that will try to fix corrupted PDF files based on\n   one of the following utilities:\n  \n   * |ss| ``gs``: Ghostscript |se|; done, *see* `fix_file_for_corruption()`_\n   * ``pdftocairo``: from Poppler\n   * ``mutool``: it does not \"print\" the PDF file\n   * ``cpdf``\n  \n   It will also check PDF files based on one of the following utilities:\n  \n   * ``pdfinfo``\n   * ``pdftotext``\n   * ``qpdf``\n   * ``jhove``\n   \n4. Add a ``remove`` subcommand that can remove annotations (incl. highlights, \n   comments, notes, arrows), bookmarks, attachments and metadata from PDF files \n   based on the `cpdf`_ utility\n   \n   **NOTE:** `pdftk`_ can also remove annotations \n\nCredits\n=======\n* Special thanks to `na--`_, the developer of `ebook-tools`_, for having made\n  these very useful tools. I learned a lot (specially ``bash``) while porting\n  them to Python.\n* Thanks to all the developers of the different programs used by this project\n  such as ``calibre``, ``Tesseract``, text converters (``djvutxt`` and\n  ``pdftotext``) and many other utilities!\n\nLicense\n=======\nThis program is licensed under the GNU General Public License v3.0. For more\ndetails see the `LICENSE`_ file in the repository.\n\nReferences\n==========\n.. [IBR] https://github.com/na--/ebook-tools#options-related-to-extracting-isbns-from-files-and-finding-metadata-by-isbn\n.. [IDGF] https://github.com/na--/ebook-tools#options-related-to-extracting-isbns-from-files-and-finding-metadata-by-isbn\n.. [IIF] https://github.com/na--/ebook-tools#options-related-to-extracting-isbns-from-files-and-finding-metadata-by-isbn\n.. [KM] https://github.com/na--/ebook-tools#general-control-flags\n.. [MFO] https://github.com/na--/ebook-tools#options-related-to-extracting-isbns-from-files-and-finding-metadata-by-isbn\n.. [OCR] https://github.com/na--/ebook-tools#options-for-ocr\n.. [OCRC] https://github.com/na--/ebook-tools#options-for-ocr\n.. [OCROP] https://github.com/na--/ebook-tools#options-for-ocr\n.. [OFT] https://github.com/na--/ebook-tools#options-related-to-the-input-and-output-files\n.. [OME] https://github.com/na--/ebook-tools#options-related-to-the-input-and-output-files\n.. [ORG] https://github.com/na--/ebook-tools#ebook-tools\n.. [ORGD] https://github.com/na--/ebook-tools#description\n.. [OWI] https://github.com/na--/ebook-tools#specific-options-for-organizing-files\n.. [OWIS] https://github.com/na--/ebook-tools#options-related-to-extracting-and-searching-for-non-isbn-metadata\n.. [PIF] https://github.com/na--/ebook-tools#specific-options-for-organizing-files\n.. [RCL] https://bit.ly/3sPJ9kT\n.. [RFFG] https://github.com/na--/ebook-tools#options-related-to-extracting-isbns-from-files-and-finding-metadata-by-isbn\n.. [SM] https://bit.ly/3sPJ9kT\n.. [TI] https://github.com/na--/ebook-tools#options-related-to-extracting-and-searching-for-non-isbn-metadata\n.. [TML] https://github.com/na--/ebook-tools#options-related-to-extracting-and-searching-for-non-isbn-metadata\n.. [WII] https://github.com/na--/ebook-tools#specific-options-for-organizing-files\n\n.. URLs\n.. _1: https://www.mobileread.com/forums/showthread.php?t=130638\n.. _2: https://github.com/na--/calibre-worldcat-xisbn-metadata-plugin\n.. _cache: https://github.com/grantjenks/python-diskcache\n.. _calibre: https://calibre-ebook.com/\n.. _catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/\n.. _conda: https://docs.conda.io/en/latest/\n.. _cpdf: https://community.coherentpdf.com\n.. _docker: https://docs.docker.com/\n.. _documentation for ebook-tools: https://github.com/na--/ebook-tools#searching-for-isbns-in-files\n.. _DjVuLibre: http://djvu.sourceforge.net/\n.. _ebook-convert: https://manual.calibre-ebook.com/generated/en/ebook-convert.html\n.. _ebook-tools: https://github.com/na--/ebook-tools\n.. _ebook-tools documentation: https://github.com/na--/ebook-tools#security-and-safety\n.. _Goodreads: https://www.mobileread.com/forums/showthread.php?t=130638\n.. _ISBNs: https://en.wikipedia.org/wiki/International_Standard_Book_Number\n.. _limitations: https://github.com/na--/ebook-tools#limitations\n.. _na--: https://github.com/na--\n.. _p7zip: https://sourceforge.net/projects/p7zip/\n.. _pdftk: https://stackoverflow.com/a/49614525/14664104\n.. _plugins: https://plugins.calibre-ebook.com/\n.. _poppler: https://poppler.freedesktop.org/\n.. _QubesOS: https://www.qubes-os.org/\n.. _Read the Docs: https://readthedocs.org/\n.. _search-ebooks: https://github.com/raul23/search-ebooks\n.. _searches: https://github.com/na--/ebook-tools#searching-for-isbns-in-files\n.. _shell scripts: https://github.com/na--/ebook-tools#script-usage-and-options\n.. _Tesseract: https://github.com/tesseract-ocr/tesseract\n.. _textutil: https://ss64.com/osx/textutil.html\n.. _Travis CI: https://travis-ci.com/\n.. _valid ISBNs: https://en.wikipedia.org/wiki/International_Standard_Book_Number#Check_digits\n.. _venv: https://docs.python.org/3/library/venv.html#module-venv\n.. _WorldCat xISBN: https://github.com/na--/calibre-worldcat-xisbn-metadata-plugin\n\n.. URLs: pyebooktools project\n.. _convert_to_txt.py: ./pyebooktools/convert_to_txt.py\n.. _default_config.py: ./pyebooktools/configs/default_config.py\n.. _default_logging.py: ./pyebooktools/configs/default_logging.py\n.. _ebooktools.py: ./pyebooktools/scripts/ebooktools.py\n.. _examples.rst: ./docs/examples.rst\n.. _find_isbns.py: ./pyebooktools/find_isbns.py\n.. _fix_file_for_corruption(): https://github.com/raul23/pyebooktools/blob/1067ce48a250404bf6225d36dd3e1defd05f751b/pyebooktools/lib.py#L461\n.. _interactive_organizer.py: ./pyebooktools/interactive_organizer.py\n.. _lib.py: ./pyebooktools/lib.py\n.. _LICENSE: ./LICENSE\n.. _organize_ebooks.py: ./pyebooktools/organize_ebooks.py\n.. _pyebooktools: ./pyebooktools\n.. _rename_calibre_library.py: ./pyebooktools/rename_calibre_library.py\n.. _search_file_for_isbns(): https://github.com/raul23/pyebooktools/blob/52795d9d45d5ae0e666a45cbafb6e4919343dfda/pyebooktools/lib.py#L880\n.. _split_into_folders.py: ./pyebooktools/split_into_folders.py\n\n.. URLs: local\n.. _all the ocr-related options: #options-for-ocr\n.. _below: #script-usage-and-options\n.. _config.py: #edit-description-label\n.. _convert: #convert-options-input-file\n.. _edit: #edit-options-main-log\n.. _find: #find-options-input-data\n.. _General control flags: #general-control-flags\n.. _interact: #security-and-safety\n.. _isbn_blacklist_regex: #isbn-blacklist-regex-label\n.. _isbn_metadata_fetch_order: #metadata-fetch-order-label\n.. _keep_metadata: #keep-metadata-label\n.. _Miscellaneous options: #miscellaneous-options\n.. _OCR ones: #options-for-ocr\n.. _Options related to the input and output files: #options-related-to-the-input-and-output-files\n.. _organize: #organize-options-folder-to-organize\n.. _organize_without_isbn: #organize-without-isbn-label\n.. _organize_without_isbn_sources: #organize-without-isbn-sources-label\n.. _output_folder_corrupt: #output-folder-corrupt-label\n.. _output_folder_pamphlets: #output-folder-pamphlets-label\n.. _output_metadata_extension: #output-metadata-extension-label\n.. _related to extracting ISBNs from files: #options-related-to-extracting-isbns-from-files-and-finding-metadata-by-isbn\n.. _rename: #rename-options-calibre-folder\n.. _Script usage, subcommands and options: #script-usage-subcommands-and-options\n.. _Security and safety: #security-and-safety\n.. _split: #split-options-folder-with-books\n.. _subcommand: #script-usage-subcommands-and-options\n.. _subcommands: #script-usage-subcommands-and-options\n.. _Usage, options and configuration: #usage-options-and-configuration\n.. _without_isbn_ignore: #without-isbn-ignore-label\n.. _-h, --help: #general-control-flags\n.. _-v, --verbose: #verbose-label\n.. _-q, --quiet: #quiet-label\n.. _--verbose: #verbose-label\n.. _--use-config: #use-config-label\n.. _-u, --use-config: #use-config-label\n.. _-d, --dry-run: #dry-run-label\n.. _--dry-run: #dry-run-label\n.. _--sl, --symlink-only: #symlink-only-label\n.. _--symlink-only: #symlink-only-label\n.. _--km, --keep-metadata: #keep-metadata-label\n.. _-r, --reverse: #reverse-label\n.. _--log-level: #log-level-label\n.. _--log-format: #log-format-label\n.. _-i, --isbn-regex: #isbn-regex-label\n.. _--isbn-blacklist-regex: #isbn-blacklist-regex-label\n.. _---mfo, ---metadata-fetch-order: #metadata-fetch-order-label\n.. _--ocr: #options-for-ocr\n.. _--owis, --organize-without-isbn-sources: #organize-without-isbn-sources-label\n.. _--oft, --output-filename-template: #output-filename-template-label\n.. _--ome, --output-metadata-extension: #output-metadata-extension-label\n\n.. |ss| raw:: html\n\n   \u003cstrike\u003e\n\n.. |se| raw:: html\n\n   \u003c/strike\u003e\n\n.. TODOs\n.. explain log-level and log-format choices of values\n.. check ocr-command option (including description)\n.. add more to description (+ examples of output filenames) for the output-filename-template option\n.. add more to description for isbn-regex option\n.. IMPORTANT: change internal url for subcommands in #security-and-safety\n.. IMPORTANT: don't forget see default value\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraul23%2Fpyebooktools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraul23%2Fpyebooktools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraul23%2Fpyebooktools/lists"}