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 02-20-2025, 05:25 AM   #1
Nicolas.Laurent
Member
Nicolas.Laurent began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jun 2016
Location: France
Device: PocketBook Touch Lux 2
Accessing Identifiers values with python

A newbie's question.

How do I list the different values in the identifiers field?
I can access a given value (ISBN in this case) using the code below, but I'd like to access all the values.

Thanks in advance.

Code:
python:
def evaluate(book, context):
	isbn = book.get('identifiers').get('isbn', '')
Nicolas.Laurent is offline   Reply With Quote
Old 02-20-2025, 06:26 AM   #2
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,185
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
Code:
python:
def evaluate(book, context):
    res = ''
    for k, v in book.get('identifiers').items():
        res += f'{k}: {v}\n'
    return res
capink is offline   Reply With Quote
Advert
Old 02-20-2025, 06:39 AM   #3
Nicolas.Laurent
Member
Nicolas.Laurent began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jun 2016
Location: France
Device: PocketBook Touch Lux 2
Perfect!
Nicolas.Laurent is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PG Identifiers Comfy.n Library Management 2 09-03-2024 07:39 AM
Converting ePub Python coding books to PDF outputs Python code far too small lysakowski Conversion 9 04-30-2023 05:44 AM
Python 2 to Python 3, Polyglot & Plugins DaltonST Calibre 18 04-24-2019 12:10 AM
Python error when accessing content server with calibredb drawson1 Library Management 1 06-19-2018 12:08 PM
Accessing the database from Python richlyon Development 2 12-13-2011 11:43 AM


All times are GMT -4. The time now is 04:40 PM.


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