A standalone command-line utility for advanced ebook collection management. This tool provides powerful features for organizing, importing, and analyzing ebook collections with support for format filtering and deduplication.
- Advanced Import: Batch import ebooks with sophisticated filtering
- Format Deduplication:
--onefilemode selects the best format per book (EPUB > MOBI > AZW > AZW3 > PDF > LRF) - Extension Filtering:
--extoption to process only specific file formats - Collection Analysis: Analyze and suggest organization structures
- Beets Integration: Works seamlessly with the beets-ebooks plugin
- Batch Operations: Process entire collections efficiently
-
Clone this repository:
git clone https://github.com/OttScott/ebook-manager.git cd ebook-manager -
Install the package:
pip install -e . -
Add to PATH (Windows):
# Run the provided script to add Python Scripts to PATH .\add_to_path.ps1 # PowerShell # OR add_to_path.bat # Command Prompt
-
(Optional) Install beets-ebooks plugin for enhanced functionality:
pip install beets beets-ebooks
# Test the commands work
ebook-manager --help
ebm --help
# Alternative: Use Python module execution
python -m ebook_manager --helpUpdate the beets executable path by editing the BEETS_EXE variable in the installed package, or set an environment variable.
After installation, you can use any of these commands:
# Full command name
ebook-manager scan C:/Books/
# Short alias (easier to type)
ebm scan C:/Books/
# Python module execution
python -m ebook_manager scan C:/Books/# Scan a collection (dry run)
ebook-manager scan /path/to/books/
# Import all ebooks from a directory
python ebook_manager.py import /path/to/books/
# Import with format filtering
python ebook_manager.py import /path/to/books/ --ext .epub,.pdf
# Import one file per book (deduplication)
python ebook_manager.py import /path/to/books/ --onefile
# Combine filtering and deduplication
python ebook_manager.py import /path/to/books/ --ext .epub,.mobi --onefile
# Import from a single directory (non-recursive)
python ebook_manager.py import-dir "/path/to/specific/author/book/"
# Batch import with progress tracking
python ebook_manager.py batch-import /path/to/books/ --ext .epub --onefile
# Analyze collection structure
python ebook_manager.py analyze /path/to/books/
# Test organization (dry run)
python ebook_manager.py test-organize
# Actually organize files
python ebook_manager.py organizeWhen using --onefile, the tool selects the highest priority format per book:
.epub(highest priority).mobi.azw.azw3.pdf.lrf(lowest priority)
# Import only EPUB files, one per book
python ebook_manager.py import C:/Books/ --ext .epub --onefile
# Scan collection showing what would be imported
python ebook_manager.py scan C:/Books/ --onefile
# Import a specific author's directory
python ebook_manager.py import-dir "C:/Books/Douglas Adams/Hitchhiker's Guide/"
# Analyze collection to understand structure
python ebook_manager.py analyze C:/Books/This utility is designed to work alongside the beets-ebooks plugin. The plugin provides the core beets integration, while this utility offers advanced collection management features.
-
Install both packages:
beets-ebooksfor plugin functionalityebook-managerfor advanced utilities
-
Configure beets with the ebooks plugin enabled
-
Use ebook-manager for advanced operations:
- Format deduplication with
--onefile - Extension filtering with
--ext - Collection analysis and organization
- Format deduplication with
| Command | Description | Options |
|---|---|---|
scan |
Scan collection (dry run) | --ext, --onefile |
import |
Import ebooks to beets | --ext, --onefile |
import-dir |
Import from single directory | --ext, --onefile |
batch-import |
Batch import with progress | --ext, --onefile |
analyze |
Analyze collection structure | --ext, --onefile |
test-organize |
Test organization (dry run) | None |
organize |
Actually organize files | None |
process |
Process single file | None |
--ext EXTENSIONS: Comma-separated file extensions (e.g.,--ext .epub,.pdf)--onefile: Import only one file per book (highest priority format)
- Python 3.7+
- Beets (for import functionality)
- beets-ebooks plugin (recommended)
# Install development dependencies
pip install -e .[dev]
# Run tests
python -m pytest tests/ -v
# Run example
python examples/onefile_demo.pyMIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
- beets-ebooks: Beets plugin for ebook management
- Beets: The music library manager that inspired this project