Python interface for Calibre's command line tools
Project description
Capybre
Thin python wrapper over (some of) the Calibre CLI. Can be used for ebook conversion, metadata-extraction, and metadata-lookup:
Simple Usages
# convert between formats; creates 'PrideAndPrejudice.mobi'
from capybre import convert
convert('PrideAndPrejudice.epub', as_ext='mobi')
# extract metadata
from capybre import extract_metada
metadata = extract_metadata('PrideAndPrejudice.epub')
# prints "Pride and Prejudice"
print(metadata.title)
# extract cover from metadata; saves as cover.jpg
from capybre import extract_cover
extract_cover('PrideAndPrejudice.epub', output_file='cover.jpg')
# fetch metadata from internet sources
from capybre import fetch_metadata
metadata = fetch_metadata(title='Pride and Prejudice')
# prints Jane Austen
print(metadata.author)
# download cover from internet sources; saves as cover.jpg
from capybre import fetch_cover
fetch_cover(title='Pride and Prejudice')
Getting Started
First, you need to download Calibre's command line tools.
You can follow instructions on Calibre's site to download, or download through package managers:
# on Ubuntu
sudo apt-get install calibre
# on MacOS
brew install calibre
On MacOS, the command line tools may not be added to your path. To access them, add /Applications/calibre.app/Contents/MacOS/
to your PATH variable, for instance in ~/.bashrc
adding
export PATH=$PATH:/Applications/calibre.app/Contents/MacOS/
Then, just install Capybre with pip!
pip install capybre
See the full documentation at https://capybre.readthedocs.io/
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
File details
Details for the file capybre-0.0.6.tar.gz
.
File metadata
- Download URL: capybre-0.0.6.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6db4c83b363b0546499306f194b2de60d88d13842c876d1d97050dea97802b85 |
|
MD5 | f472aac9f7470823bc0a4150b01164e6 |
|
BLAKE2b-256 | 75f86daf6253df2bc4475a199a31db0c6e7b4ff6d3337c45bfd9e2543ae3d3d4 |
File details
Details for the file capybre-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: capybre-0.0.6-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b10f6d8b979ac4dc9b6e75ffd331c2f88295e9bf13a9cc530ab21d2269993991 |
|
MD5 | a072362c16883dd3f0224502ce5ec968 |
|
BLAKE2b-256 | 2b83d16a3bc9b167fe008a199717393fb0139c8a54668b6ced0eab0086ab34ae |