PyCalibre
PyCalibre is a Python library designed to facilitate interaction with a Calibre ebook library. It provides a set of classes and methods to manage ebooks, their metadata, and the library structure efficiently.
Features
- Load and manage your Calibre library.
- Add and remove books from the library.
- Search and retrieve book information.
- Handle ebook metadata with ease.
Installation
To install PyCalibre, you can use Poetry. First, ensure you have Poetry installed, then run:
poetry install
Usage
To use PyCalibre, you can start by importing the library and initializing your Calibre library instance. Here’s a simple example:
from pycalibre import Library
with Library("path/to/library") as library:
# Do stuff here
The Library class acts as a context manager, so you don't need to worry about cleaning up.
You can then easily find books in your library by different criteria:
# ... within a Library context
books = library.find_books(author="Austen")
for book in books:
print(book.title)
Updating books is straightforward as well:
book.update(title="New title", add_tags=["New Tag"], remove_tags=["Old Tag"])
You can work with custom columns as if they were native ones:
print(book.my_custom_column)
book.update(my_custom_column="Hello")
You can also get all the formats of a book:
for fmt in book.get_formats():
with open(fmt.file_path, 'rb') as f:
contents = f.read()
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes. My main motivation in making this package is to help me write maintenance and analysis scripts for my Calibre library, but I am happy for it to be extended to support the needs of others.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for pycalibre 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pycalibre-0.1.0.tar.gz | 22.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycalibre-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.7 kB
Release files / pycalibre-0.1.0.tar.gz
| Download URL | pycalibre-0.1.0.tar.gz |
|---|---|
| Size | 22.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3314a5af13d4e84fc73fc7cc4379b58e80e0c6738071aabd4338ffa449680df5
|
|
BLAKE2b-256 checksum How to use checksums |
22cf4e2b7c7f96dd75bbf051e181eaf0eb9707e762e76d3ce497c3e1675751af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.4 Windows/11
|
Release files / pycalibre-0.1.0-py3-none-any.whl
| Download URL | pycalibre-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36b05cc8e49ade49089a0d50a3ef86d802e1e861a03794e0b11bd3a38e178ba2
|
|
BLAKE2b-256 checksum How to use checksums |
3cdbf0e21579762cc74b4b09ff0e75e5ffdfdf990c93e6aa784d287d23821476
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.4 Windows/11
|