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-08-2014, 09:40 AM   #1
WimmeR
Junior Member
WimmeR began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2014
Location: Belgium
Device: Sony PRS-T1
EPUB metadata used by Calibre

Hello,

I have created an EPUB that is part of a series. I have put
Code:
<meta content="Series Name" name="calibre:series" />
<meta content="1" name="calibre:series_index" />
in the content.opf file of the EPUB.

When I add the book, calibre correctly parses this data and it appears in the metadata. I tried to do the same with the creation date and the publication date but it doesn't work. I googled for calibre metadata but everytime I get explanations on how to use the metadata editor which is not what I want. I want to create an EPUB that can be added to the calibre library including the correct metadata.
I then downloaded the complete source code of calibre and found "calibre:series_index" in opf2.py. In that same file I found references to pubdate_path (which apparently uses a "date" tag) and timestamp.
I used the date tag and the timestamp tag using the dc and calibre namespaces, but every time I add the book, calibre insists on putting today's date in Date, Published and Modified.

Can someone please explain which metadata tags from the EPUB are processed by calibre and where I have to put them in the EPUB so that calibre can find them?

Thanks
-=Wim=-
WimmeR is offline   Reply With Quote
Old 04-08-2014, 11:05 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just set some distinctive values for your desired metadata in calibre then save an epub to disk, open it up and see how calibre saves the metadata fields you are interested in.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-08-2014, 12:41 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Here is an example content.opf from a book in my library (see attachment). It appears to be using:
Code:
<meta name="calibre:timestamp" content="2013-01-20T05:45:35+00:00"/>
to correspond to calibre's "Date" field, and:
Code:
<dc:date>2003-01-02T00:00:00+00:00</dc:date>
to correspond to calibre's "Published" field.
Attached Files
File Type: opf example content.opf (31.5 KB, 402 views)
eschwartz is offline   Reply With Quote
Old 04-08-2014, 12:44 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I am pretty sure calibre will insist on putting the current datetime in as "Date" which represents the date added to calibre, unless you import the book SAVE, not just the book. Since that will usually include calibre's metadata.opf, it will set all metadata according to the metadata.opf, including the Added-to-calibre datetime.
eschwartz is offline   Reply With Quote
Old 04-09-2014, 06:08 AM   #5
WimmeR
Junior Member
WimmeR began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2014
Location: Belgium
Device: Sony PRS-T1
So I edited the metadata of a book (I put 2008-10-12 in the date field and 2010-12-14 in the published field), opened metadata.opf from the book folder and found these:
Code:
<dc:date>2010-12-13T23:00:00+00:00</dc:date>
<meta content="2008-10-11T22:00:00+00:00" name="calibre:timestamp"/>
So the "date" field has the "calibre:timestamp" tag and the "published" field has the "dc:date" tag, as eschwartz already pointed out.
Next, I put
Code:
<meta content="2010-12-13T23:00:00+00:00" name="dc:date" />
<meta content="2008-10-11T22:00:00+00:00" name="calibre:timestamp" />
in the content.opf file of the EPUB.
I remove the book from the calibre library, and add the modified one.
In the metadata.opf file I find:
Code:
<dc:date>2014-04-08T22:00:00+00:00</dc:date>
<meta content="2014-04-09T09:39:48.364000+00:00" name="calibre:timestamp"/>
which is not what I've put in.

Observations:
1) calibre does not interpret the content.opf file of the EPUB correctly.
2) calibre uses different rules for the timezone (I'm in UTC+2).
If I enter 2008-10-12 in the DATE field in the UI, calibre subtracts 2 hours
If I enter 2010-12-14 in the PUBLISHED field, calibre subtracts 1 hour
Apart from the fact that it is nonsense to store a published date with a time part, the rules must be the same.
3) The date field is saved in a different format: the result of editing in the UI saves the date up to seconds (without fractional part) while when adding a book, the date is saved up to 1 millionth of a second.

(let's not get distracted by observations 2 and 3, the real problem is observation 1)

-=Wim=-
WimmeR is offline   Reply With Quote
Advert
Old 04-09-2014, 09:43 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I have no idea what you are doing.

1) <dc:date> is used for the published date

2) You cannot control the date field via the OPF since the date field always shows the date the book was added to calibre regardless of the value of calibre:timestamp

It is nonsense to not put a time into a timestamp field. When you put in only a date what you are actually doing is saying the date is what you say it is +- 1 day depending on which timezone the person interpreting the date is in. Not to mentiont hat plenty of publications can have intra day publication dates.
kovidgoyal is offline   Reply With Quote
Old 04-09-2014, 11:42 AM   #7
WimmeR
Junior Member
WimmeR began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2014
Location: Belgium
Device: Sony PRS-T1
Quote:
Originally Posted by kovidgoyal View Post
I have no idea what you are doing.
I'm sorry, I'll try to give some more context. I created an EPUB with Sigil. In the metadata editor of Sigil I saw 3 dates: Date:Creation, Date:Modification and Date:Publication. In the book list of calibre I also see 3 dates: Date, Published and Modified. I assumed that these dates meant the same in both applications (I now know they don't). What I tried to do was to get calibre "read" the dates of the EPUB, so that I didn't have to modify them afterwards in calibre.

Quote:
Originally Posted by kovidgoyal View Post
1) <dc:date> is used for the published date
Yes. But if I have a book that was published say in 2010 and I add it in calibre, why does the Published column show today's date?
I figured I did something wrong with the metadata in the EPUB so basically, that was my initial question: which tag do I have to use in the contents.opf of the EPUB so that calibre can recognise it?

Quote:
Originally Posted by kovidgoyal View Post
2) You cannot control the date field via the OPF since the date field always shows the date the book was added to calibre regardless of the value of calibre:timestamp
Ok, I didn't know that. I (wrongfully) thought that the date field was the created date (i.e. the date that the EPUB was first created, analogous to the created date of a file on a filesystem).

Quote:
Originally Posted by kovidgoyal View Post
It is nonsense to not put a time into a timestamp field. When you put in only a date what you are actually doing is saying the date is what you say it is +- 1 day depending on which timezone the person interpreting the date is in.
Right, BUT: in the metadata editor of calibre, you cannot enter a time in the date or published field. You therefore should assume that the time is 00:00:00+00:00 and not compensate for timezone differences when saving.
Assume a book was published on christmas and I would enter 2013-12-25 (remember I'm in time zone +2). I then take my library (which is on a thumb drive) and I open it on a computer in London (UTC) then all of a sudden the book *appears* to be published the day before christmas.
What I want to say is that IMHO a publication date is a fixed date, regardless in which timezone you look at it.
I don't want to be pedantic, but Dublin Core says that dc:date follows the YYYY-MM-DD format (see point 4.12. of http://dublincore.org/documents/usag...elements.shtml). The time part is not present.

Quote:
Originally Posted by kovidgoyal View Post
Not to mentiont hat plenty of publications can have intra day publication dates.
I'm not sure I understand. Do you mean that the same publication is published multiple times the same day?

-=Wim=-
WimmeR is offline   Reply With Quote
Old 04-09-2014, 05:16 PM   #8
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,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@WimmeR - You can control the format of the 3 dates that calibre keeps, including the inclusion of time, via Preferences->Tweaks->Control how dates are displayed

Quote:
Originally Posted by WimmeR View Post
I'm not sure I understand. Do you mean that the same publication is published multiple times the same day?
News agencies etc often update their news reports to correct errors, this is usually indicated in the news reports dateline and a note at the bottom. So yes the same 'book' can be published multiple times on the same day.

Quote:
Originally Posted by WimmeR View Post
Assume a book was published on christmas and I would enter 2013-12-25 (remember I'm in time zone +2). I then take my library (which is on a thumb drive) and I open it on a computer in London (UTC) then all of a sudden the book *appears* to be published the day before christmas
I agree with you, the published date/time that I see in calibre should be the wall date & time at the place where the event happened (book published, news report filed etc), it should have nothing to do with the time setting on the computer I happen to be using.

I'm not so bothered by date/time the book was added to calibre (timestamp), and even less by calibre's modified date because it can change 'unexpectedly'

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Metadata not same as EPub Meta Brovig Library Management 30 12-01-2015 06:01 PM
Writing Calibre Metadata directly into ePub files? strongnc21 Calibre 5 09-09-2013 12:25 AM
Insert metadata as page at start of book (epub to epub) eosrose Conversion 12 08-09-2012 11:25 AM
Calibre/ePub Metadata carmenchu Library Management 5 09-07-2011 03:13 PM
Metadata from calibre converted epub wannabee Kindle Formats 0 03-01-2011 12:05 AM


All times are GMT -4. The time now is 02:43 AM.


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