Giter VIP home page Giter VIP logo

capybre's Introduction

Capybre

Tests Documentation Status PyPI version

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/

capybre's People

Contributors

digitaltembo avatar

Stargazers

Krazy Bug avatar Cioclea Doru Octavian avatar  avatar 千橙 avatar

Watchers

 avatar

Forkers

nielsbosma

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.