Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-05-2020, 01:24 AM   #1
galaxyhub
Member
galaxyhub began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2019
Device: Kindle Paperwhite, Galaxy Tab S2 8.0
question about epub opf file

Is there a way to not include the
<meta name="calibre:user_metadata ....
entries in the opf. I would like to retain the dc: entries and the <meta content entries.

Also is there a batch way to strip the <meta name="calibre:user_metadata .... out of my epubs. I know the excellent Modify ePub plugin has an option to remove non dc: elements but this will strip out the series information that I need as well.
galaxyhub is offline   Reply With Quote
Old 04-06-2020, 05:02 AM   #2
carmenchu
Groupie
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
Posts: 191
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
Comment + suggestion:
1. The .opf file of a book should not/could not be changed: it contains the data to restore the calibre database in case of accident (or so I understand)
2. How those data are copied to an .epub by convert/polish->update metada is another question.
There, I would like as well to delete the user information, AFTER having employed some of my <meta name="calibre:user_metadata:#customized"... . For instance:
<meta name="calibre:user_metadata:#ordate"...content... &quot;__value__&quot;: &quot{date}&quot; -> <dc:date opf:event="creation">{date}</dc:date>
I suspect this would require a plug-in, but I don't know where to begin--a template to get started?
carmenchu is offline   Reply With Quote
Advert
Old 04-06-2020, 05:27 AM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by carmenchu View Post
Comment + suggestion:
1. The .opf file of a book should not/could not be changed: it contains the data to restore the calibre database in case of accident (or so I understand)
2. How those data are copied to an .epub by convert/polish->update metada is another question.
There, I would like as well to delete the user information, AFTER having employed some of my <meta name="calibre:user_metadata:#customized"... . For instance:
<meta name="calibre:user_metadata:#ordate"...content... &quot;__value__&quot;: &quot{date}&quot; -> <dc:date opf:event="creation">{date}</dc:date>
I suspect this would require a plug-in, but I don't know where to begin--a template to get started?
1. no, you can do what you like to the content.opf file in the book within the bounds of the ePub specs; the calibre library manager won't know or care. It is the metadata.opf files in the book folders that are used to restore the database (if/when it gets broken - which has never happened to me in about 9 years).

2. The .opf files in the book are built from the content of the database, as are the metadata.opf files. But, don't equate the .opf file in the book and the metadata.opf file in the book folders. Whilst they have similarities they serve different purposes. And what's in the book will not reflect what's in the database if you don't Polish, Modify or Convert (ePub to ePub), but the metadata.opf file in the book folder will** always reflect what's in the database.

**if you do a bulk edit to many books, the updating of the metadata.opf files in the book folders happens in a low priority background task that may take a while to catch up.

BR
BetterRed is offline   Reply With Quote
Old 04-06-2020, 09:53 AM   #4
carmenchu
Groupie
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
Posts: 191
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
Quote:
Originally Posted by carmenchu View Post
Comment + suggestion:
1. The .opf file of a book should not/could not be changed: it contains the data to restore the calibre database in case of accident (or so I understand)
2. How those data are copied to an .epub by convert/polish->update metada is another question.
There, I would like as well to delete the user information, AFTER having employed some of my <meta name="calibre:user_metadata:#customized"... . For instance:
<meta name="calibre:user_metadata:#ordate"...content... &quot;__value__&quot;: &quot{date}&quot; -> <dc:date opf:event="creation">{date}</dc:date>
I suspect this would require a plug-in, but I don't know where to begin--a template to get started?
My fault: (1) was about metadata.opf. (2) Is what I would wish done (automatically) to the .opf file in the epub: doing it (and more) by hand every time.
carmenchu is offline   Reply With Quote
Old 04-06-2020, 04:46 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
You can use the Modify ePub plugin to strip the metadata back to Dublin Core elements - i.e. those prefixed by dc:.

The Sigil ePub editor has a GUI tool to add, change, delete metadata items within the embedded .opf, being a minimalist I use it to remove dc:description and dc:subjects.

Beyond that you can edit the embedded .opf with a text editor or one of the ePub editors. Or you can write, or hack an existing, plugin to meet your specific wants.

Take care

BR
BetterRed is offline   Reply With Quote
Advert
Old 04-07-2020, 11:59 AM   #6
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,511
Karma: 78910202
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
I wonder if this tool might help. https://www.mobileread.com/forums/sh...d.php?t=132607
PeterT is offline   Reply With Quote
Old 04-10-2020, 02:55 AM   #7
galaxyhub
Member
galaxyhub began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2019
Device: Kindle Paperwhite, Galaxy Tab S2 8.0
my main libraries are all epub only on onedrive, convert as needed then delete the other formats. So batch editing of opf would be ideal to remove all the opf mess excepting dc elements and series name and index.
galaxyhub is offline   Reply With Quote
Old 04-10-2020, 10:57 AM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,181
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by galaxyhub View Post
my main libraries are all epub only on onedrive, convert as needed then delete the other formats. So batch editing of opf would be ideal to remove all the opf mess excepting dc elements and series name and index.
One thing you might want to consider is moving your libraries to local storage. A library stored in the cloud is a disaster waiting to happen. You may get away with it for years and then hope you have a good backup. One recent thread is found at Library management issues after editing metadata.

Also remember that when you save your epub to disk or send to a device, the metadata will be updated from calibre's metadata.opf file.

Last edited by DNSB; 04-10-2020 at 11:00 AM.
DNSB is offline   Reply With Quote
Old 04-10-2020, 05:23 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DNSB View Post
Also remember that when you save your epub to disk or send to a device, the metadata will be updated from calibre's metadata.opf file.
Pretty sure that's false.

The metadata embedded into the file that is Saved or Sent will be taken from the database library metadata.db file, if you just did bulk update the update of the metadata.opf file could still be in the lazy write queue.

BR
BetterRed is offline   Reply With Quote
Old 04-10-2020, 06:16 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,181
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by BetterRed View Post
Pretty sure that's false.

The metadata embedded into the file that is Saved or Sent will be taken from the database library metadata.db file, if you just did bulk update the update of the metadata.opf file could still be in the lazy write queue.

BR
Perhaps I should have just said the metadata embedded in the epub file that is sent or saved will be updated to match the corresponding metadata.opf -- assuming all lazy writes are completed.

It's a lot easier to look at the metadata.opf compared to browing the database file.

Last edited by DNSB; 04-10-2020 at 06:18 PM.
DNSB is offline   Reply With Quote
Old 04-10-2020, 06:41 PM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DNSB View Post
It's a lot easier to look at the metadata.opf compared to browing the database file.
For you maybe, but you ain't embedding the data in to the Saved/Sent files. The calibre software has the in memory database at its fingertips

FWIW I find it easier to press 'I' on a book to see all of its metadata.

BR
BetterRed is offline   Reply With Quote
Old 04-10-2020, 07:08 PM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,181
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by BetterRed View Post
For you maybe, but you ain't embedding the data in to the Saved/Sent files. The calibre software has the in memory database at its fingertips

FWIW I find it easier to press 'I' on a book to see all of its metadata.

BR
But I'm the one looking at the metadata with that old fashioned mark 1 eyeball. AFAIK, calibre doesn't supply a handy tool to show me all the metadata for an ebook in a human readable form. Maybe, it would be better to say, I don't know of such a handy tool in calibre.

Hitting 'I' doesn't show me all the metadata I'm interested in. Such items as are fonts correctly identified and does the titlepage entry have the svg properties set. Yeah, I know. That's what epubcheck is for.
DNSB is offline   Reply With Quote
Old 04-10-2020, 07:47 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I didn't know the metadata.opf had font and other typographical artefacts in it. I mainly buy books for their content rather than their looks so I don't look for that stuff, except to delete it. I say mainly, because I did buy one book based purely on its appearance, it wasn't an ebook, it caught my eye on a remainder table.

BR
BetterRed is offline   Reply With Quote
Old 04-10-2020, 08:25 PM   #14
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DNSB View Post
But I'm the one looking at the metadata with that old fashioned mark 1 eyeball. AFAIK, calibre doesn't supply a handy tool to show me all the metadata for an ebook in a human readable form. Maybe, it would be better to say, I don't know of such a handy tool in calibre.

Hitting 'I' doesn't show me all the metadata I'm interested in. Such items as are fonts correctly identified and does the titlepage entry have the svg properties set. Yeah, I know. That's what epubcheck is for.
Confusion Reigns
'I' shows CALIBRE (db) metadata in full
content.opf (part of the book) contains the structure as well as metadata. embedded fonts is STRUCTURE.

Note the Quality check PI opens the books content,opf to determine fonts embedded. It does not enumerate which ones
theducks is offline   Reply With Quote
Old 04-10-2020, 09:07 PM   #15
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,181
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by theducks View Post
Confusion Reigns
'I' shows CALIBRE (db) metadata in full
content.opf (part of the book) contains the structure as well as metadata. embedded fonts is STRUCTURE.

Note the Quality check PI opens the books content,opf to determine fonts embedded. It does not enumerate which ones
True. The only time I look at metadata.opf is when I am wondering where some odds and sods in the epub's content.opf came from.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change markup in content.opf when importing .epub file? Tom11880 Library Management 3 12-29-2018 06:21 AM
ePub3 to Mobi Error - Error(prcgen):E21027: Epub file has more than one opf file dtsmith Kindle Formats 4 01-30-2018 11:20 AM
TWO OPF files or something like Media Queries in the OPF file for KF8 and MOBI? DHahn Kindle Formats 3 04-17-2012 04:06 AM
ePub OPF file error soulartist ePub 4 10-03-2011 05:09 PM
Complete newbie to epub/opf question PeterHanes Workshop 3 11-27-2010 05:01 AM


All times are GMT -4. The time now is 08:55 AM.


MobileRead.com is a privately owned, operated and funded community.