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 11-11-2011, 05:48 PM   #1
BerlinerKindl
Junior Member
BerlinerKindl began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
calibredb remove ...

Hi,

is there a way to delete alot of book at the same time from Calibre via the "calibredb remove" command?

I will delete all books with tags:"x" or all book with series:"y".

Something like this:

Code:
calibredb list -s series:"xxx" | calibredb remove
Thanks
BerlinerKindl is offline   Reply With Quote
Old 11-11-2011, 09:36 PM   #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,580
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibredb remove -h
Usage: calibredb remove ids

Remove the books identified by ids from the database. ids should be a comma separated list of id numbers (you can get id numbers by using the list command). For example, 23,34,57-85
kovidgoyal is offline   Reply With Quote
Advert
Old 11-20-2011, 06:03 AM   #3
BerlinerKindl
Junior Member
BerlinerKindl began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
Thanks but after an

Code:
calibredb remove 1223-1237
I get this error:

Code:
Traceback (most recent call last):
  File "site.py", line 58, in main
  File "site-packages/calibre/library/cli.py", line 1192, in main
  File "site-packages/calibre/library/cli.py", line 361, in command_remove
ValueError: int() base must be >= 2 and <= 36
BerlinerKindl is offline   Reply With Quote
Old 11-20-2011, 06:08 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,580
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Typo, fixed in next release.
kovidgoyal is offline   Reply With Quote
Old 11-20-2011, 07:27 AM   #5
BerlinerKindl
Junior Member
BerlinerKindl began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
Thanks, waiting for next release.
BerlinerKindl is offline   Reply With Quote
Advert
Old 11-25-2011, 11:14 AM   #6
BerlinerKindl
Junior Member
BerlinerKindl began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
Works better but the last book would be not remove from library.

Code:
calibredb remove 12-15
This removed the books 12, 13 and 14 but NOT 15.

Thanks
BerlinerKindl is offline   Reply With Quote
Old 11-25-2011, 09:24 PM   #7
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,580
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's the way lists indices work in python. Use 12-16
kovidgoyal is offline   Reply With Quote
Old 09-17-2025, 01:54 AM   #8
TomVerse
Junior Member
TomVerse began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2025
Device: none
calibredb remove in batch process

Hi,
I am trying to do something like BerlinerKindle.
The calibre program (8.10) runs on Windows 10 and the library and books are on my NAS. Everything works fine.
I want to automate a cleaning process and run the calibredb commands in a batch file.
I can find the required id's with
calibredb search tags:"=YourTag"
but don't know how I can pass the info to the calibredb remove-command.
What doesn't work is
calibredb search tags:"=YourTag" | calibredb remove
Result: Another program such as calibre-server.exe or the calibre main program is open. Having multiple programs open that can make changes to a calibre library is a bad idea. calibredb can connect directly to an open calibre Content server to make changes there. See the --with-library option documentation for details. Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
OSError: [Errno 22] Invalid argument
There is no other calibre program running, is stacking the two commands the problem?

Trying to cut the action in two lines
1. calibredb search tags:"=YourTag" >>c:\temp\calibre_testing.txt
2. calibredb remove "c:\temp\calibre_testing.txt"
doesn't work either
Result: Traceback (most recent call last):
File "runpy.py", line 198, in _run_module_as_main
File "runpy.py", line 88, in _run_code
File "site.py", line 83, in <module>
File "site.py", line 78, in main
File "site.py", line 50, in run_entry_point
File "calibre\db\cli\main.py", line 253, in main
File "calibre\db\cli\main.py", line 40, in run_cmd
File "calibre\db\cli\cmd_remove.py", line 46, in main
File "calibre\db\cli\__init__.py", line 14, in integers_from_string
ValueError: invalid literal for int() with base 10: 'c:\\temp\\calibre_testing.txt'

Can you tell me what I do wrong or is it simply not possible to do this in batch?
TomVerse is offline   Reply With Quote
Old 09-17-2025, 04:25 AM   #9
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,580
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
First pipe the output of your search into a variable. Then execute the remove command. Like this:

Code:
ids=$(calibredb search whatever)
calibredb remove $ids
adnust the syntax for whatever actual shell you are using.
kovidgoyal is offline   Reply With Quote
Old 09-22-2025, 05:07 AM   #10
TomVerse
Junior Member
TomVerse began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2025
Device: none
Thanks a million!
TomVerse is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibredb list iomari Calibre 9 10-12-2011 11:30 AM
calibredb list no subseries_index reup Library Management 5 10-11-2011 10:32 AM
calibredb iomari Calibre 6 10-10-2011 08:35 AM
calibredb strange behaviour webwizard Library Management 9 04-17-2011 10:17 AM
RFE: Remove remove tags in bulk edit magphil Calibre 0 08-11-2009 10:37 AM


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


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