libra is a Python package designed to help you organize and explore your eBook collection.
Project description
Libra Ebook Manager
A Python package to scan a directory of eBooks, extract metadata, and generate an HTML file to display the eBook library with search functionality and Google search links.
Features
- Scan eBook Directory: Recursively scans a directory for eBook files (PDF, EPUB, etc.).
- Extract Metadata: Extracts metadata such as title, author, format, and size.
- Generate HTML: Creates an HTML file to display the eBook library in a clean, searchable format.
- Google Search Links: Adds a "Click to Google" link below each book's title to search for the book on Google.
- Search Functionality: Allows users to search for books by name or title.
Installation
-
Clone the Repository:
git clone https://github.com/yourusername/libra.git cd libra
-
Install Dependencies:
pip install -r requirements.txt
-
Install the Package:
pip install .
Usage
Command-Line Interface
Run the libra command to scan a directory and generate the HTML file:
libra
You will be prompted to enter the path to your eBook folder. After processing, the script will generate two files:
libra_ebook_data.json: Contains metadata for all eBooks.libra_ebook_library.html: Displays the eBook library in a browser.
Example
$ libra
Enter the path to your eBook folder: /path/to/your/ebook/folder
JSON data saved to libra_ebook_data.json
HTML file generated at libra_ebook_library.html. Open it in a browser to view your eBook library.
HTML Output
The generated libra_ebook_library.html file will display the eBooks in a clean, searchable format. Each book entry includes:
- Title: The title of the book (or the file name if the title is unavailable).
- Author: The author of the book (or "Unknown" if unavailable).
- Format: The file format (e.g., PDF, EPUB).
- Size: The file size in KB.
- Click to Google: A link to search for the book on Google.
Customization
HTML Template
You can customize the HTML template in the html_generator.py file to change the layout, styling, or functionality.
Dependencies
- Pillow: For image manipulation (optional for thumbnails).
- PyMuPDF (fitz): For extracting PDF and EPUB pages as images (optional for thumbnails).
- ebooklib: For handling EPUB metadata.
- python-magic: For detecting file types.
Contributing
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues or have questions, please open an issue on the GitHub repository.
Acknowledgments
- Thanks to the developers of
Pillow,PyMuPDF,ebooklib, andpython-magicfor their excellent libraries. - Inspired by the need for a simple eBook library manager.
Enjoy managing your eBook collection with Ebook Manager! 📚
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libraebookmanager-0.1.tar.gz.
File metadata
- Download URL: libraebookmanager-0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
249de8489c1d9fe5d266a49977f27df134d510cac3f875936db3d4deef051182
|
|
| MD5 |
74fac235a3fb42b0e43a967e78360fee
|
|
| BLAKE2b-256 |
f5f49371c584b069053231c311238edda97a45ae5855f78a78ccf728d5fc474e
|
File details
Details for the file libraebookmanager-0.1-py3-none-any.whl.
File metadata
- Download URL: libraebookmanager-0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa72ecb89de529668107d0b21ca7476bc4330bfab7adf54968753dd5a12e7a8a
|
|
| MD5 |
d0766e5ef76fbd2c4efc75120401e5b2
|
|
| BLAKE2b-256 |
e8cff57ecacd091377e8b3023c7e3516960b7634102e56c9bef6e4bb64186d47
|