https://github.com/davekeogh/epubmangler
Tools to modify the metadata of EPUB files
https://github.com/davekeogh/epubmangler
digital-publishing ebooks epub epub3 metadata publishing python
Last synced: 5 months ago
JSON representation
Tools to modify the metadata of EPUB files
- Host: GitHub
- URL: https://github.com/davekeogh/epubmangler
- Owner: davekeogh
- License: bsd-3-clause
- Created: 2015-06-16T12:01:55.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2024-12-15T06:02:01.000Z (over 1 year ago)
- Last Synced: 2025-09-27T21:26:10.550Z (9 months ago)
- Topics: digital-publishing, ebooks, epub, epub3, metadata, publishing, python
- Language: Python
- Homepage:
- Size: 585 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# epubmangler
Tools to read and modify the metadata of EPUB files.
Documentation to be written. See the minimal example below and others in the `example` directory.
Requires: Python 3.8
## Example usage
```python
from epubmangler import EPub
with EPub('Frankenstein.epub') as book: # https://gutenberg.org/ebooks/84
# Get information about a book
language = book.get('language')
subjects = book.get_all('subject')
book.pretty_print()
# Modify existing elements
book.set('title', 'Frankenstein 2')
book.set_cover('cat_picture.jpg')
book.set_identifier('http://github.com/davekeogh/epubmangler', 'URI')
# Add and remove elements
book.add('contributor', 'epubmangler', {'opf:role' : 'bkp'})
book.remove('date', {'opf:event' : 'conversion'})
# Add and remove subjects
book.add_subject('Sequel')
book.add_subject('Comedy')
book.remove_subject('Horror tales')
book.save('Frankenstein 2.epub', overwrite=True)
```