Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 05-16-2020, 06:18 PM   #1
DictatorAlly
Enthusiast
DictatorAlly began at the beginning.
 
Posts: 26
Karma: 10
Join Date: May 2020
Device: None
Are there good examples of command line importing / metadata / library management

I'd like to create a script to automate importing and upgrading metadata, it would great to see any examples of this.

Thank you.
DictatorAlly is offline   Reply With Quote
Old 05-16-2020, 09:28 PM   #2
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 DictatorAlly View Post
I'd like to create a script to automate importing and upgrading metadata, it would great to see any examples of this.

Thank you.
Only if someone figures out a way to pick the discovered metadata options as well as the mark 1 eyeball does. The current Download metadata and covers option from Edit metadata is a pretty decent example of what is wrong with automatic download and import of metadata. I have yet to find a metadata source that is even close to trustworthy. By trustworthy, I mean automatically update 25 books and not have to modify the metadata and covers for more than 5.
DNSB is offline   Reply With Quote
Advert
Old 05-16-2020, 11:44 PM   #3
DictatorAlly
Enthusiast
DictatorAlly began at the beginning.
 
Posts: 26
Karma: 10
Join Date: May 2020
Device: None
Quote:
Only if someone figures out a way to pick the discovered metadata options as well as the mark 1 eyeball does
Yeah it is not an easy task, but an impossible task for 1 unless you're only updating a handful of items.

Quote:
The current Download metadata and covers option from Edit metadata is a pretty decent example of what is wrong with automatic download and import of metadata. I have yet to find a metadata source that is even close to trustworthy. By trustworthy, I mean automatically update 25 books and not have to modify the metadata and covers for more than 5.
I don't find it nearly as bad.

My current plan would involve, all automatically:
  1. import new books files (epub,mobi,pdf) into a staging library.
  2. remove all tags
  3. filter out content which is not a book, news ect, and tag it.
  4. create a list of all items where tag:false
  5. for this list, update Metadata with the Kobo plugin (reject an update that would change either title/author)
  6. send rejected items to their own library, Kobo rejects
  7. create a new list of items where tag:false
  8. for this list, update Metadata with the same criteria as before using the Goodreads plugin
  9. send rejected items to their own library, Goodreads rejects
  10. send all items with a tag to main Calibre library
  11. send items which remain to another library, failed imports

With the tools available I think this will do an alright job.

Note: I talked about creating a list of items, but I think it would be better to process each item individually, it is very much a work in process.
DictatorAlly is offline   Reply With Quote
Old 05-17-2020, 12:28 AM   #4
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,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There are command line tools in calibre for downloading metadata, updating metadata of items in calibre libraries, etc. Use them, there is a whole section on the command line tools in the user manual.
kovidgoyal is offline   Reply With Quote
Old 05-17-2020, 10:41 AM   #5
DictatorAlly
Enthusiast
DictatorAlly began at the beginning.
 
Posts: 26
Karma: 10
Join Date: May 2020
Device: None
Quote:
Originally Posted by kovidgoyal View Post
There are command line tools in calibre for downloading metadata, updating metadata of items in calibre libraries, etc. Use them, there is a whole section on the command line tools in the user manual.
Thanks, that is the plan! The user manual is very informative on them.

I've got one issue though, The fetch-ebook-metadata CLI doesn't see my user installed Plugins? Where are they installed?

I can find three fetch-ebook-metadata CLI's in the container. One each in:
  • /bin/fetch-ebook-metadata
  • /opt/calibre/fetch-ebook-metadata
  • /opt/calibre/bin/fetch-ebook-metadata

The first two only search with Amazon / Google. And the last has an error:

Code:
/opt/calibre/bin/fetch-ebook-metadata: error while loading shared libraries: libcalibre-launcher.so: cannot open shared object file: No such file or directory
I am user the linuxserver/calibre container.
DictatorAlly is offline   Reply With Quote
Advert
Old 05-17-2020, 10:59 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,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
plugins are stored in the calibre config directory whose location can be controlled via an env var, see the manual https://manual.calibre-ebook.com/cus...ment-variables and you can install them from the command line with calibre-customize
kovidgoyal is offline   Reply With Quote
Old 05-17-2020, 01:22 PM   #7
DictatorAlly
Enthusiast
DictatorAlly began at the beginning.
 
Posts: 26
Karma: 10
Join Date: May 2020
Device: None
Ok so to use the fetch-ebook-metadata with a third party plugin via CLI I should install it again via CLI with calibre-customize. Thank you I have found the plugin.zip's in .config/calibre/plugins in my calibre_config_directory.

What is the path to where Calibre operates the user installed plugins from though?
DictatorAlly is offline   Reply With Quote
Old 05-17-2020, 01:45 PM   #8
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,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
all user installed plugins in the calibre config directory are automatically used.
kovidgoyal is offline   Reply With Quote
Old 05-17-2020, 04:21 PM   #9
DictatorAlly
Enthusiast
DictatorAlly began at the beginning.
 
Posts: 26
Karma: 10
Join Date: May 2020
Device: None
I see all the plugin's in .config/calibre/plugs are all .zip archives. I incorrectly thought for Calibre to use them, first Calibre would have to unpack them elsewhere. Now I see that it is using them as they are from the .zip archives. Very interesting. Thank you for the help .
DictatorAlly is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing books via command line *in the background*? mrowz Calibre 12 05-26-2017 11:30 AM
bulk metadata download through command line woodapple Calibre 13 09-02-2013 04:50 PM
Adding custom fields when importing books via command line chemi Library Management 7 02-25-2013 10:16 PM
Command Line Search and Replace Metadata metalhammer Calibre 1 05-02-2012 05:13 AM
Checking and Importing from the Command Line markbond1007 Calibre 3 08-06-2009 12:46 PM


All times are GMT -4. The time now is 03:10 PM.


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