Skip to content

Calibre

https://calibre-ebook.com/

Calibre is a powerful, user-friendly and completely free open source software for managing e-books on Windows, macOS and Linux. It is written in and extensible using Python.

  1. Save as a file:
    import calibre.ebooks.metadata.meta
    import calibre.library
    db = calibre.library.db('/path/to/library').new_api
    path = "/path/to/book.epub"
    md = calibre.ebooks.metadata.meta.get_metadata(
    open(path, "rb"),
    stream_type="epub",
    )
    db.add_books(
    [
    (
    md,
    {
    "EPUB": path,
    }
    )
    ]
    )
2. Run the file using `calibre-debug`:
```shell
calibre-debug something.py
```