Modified metadata does not merge with original entries despite keeping the same ID

Hi! So, I have a library which is linked to a directory. I wanted to add transliterated short titles to my entries (most of which are in cyrillic or other non-latin alphabets) in Zotero. To do this, I created a simple python script:

with open("exported metadata.json", "r", encoding="utf-8") as f:
data = json.load(f)
for item in data:
title=item.get("title")
if not title:
continue
item["shortTitle"] = unidecode(title)

with open("exported meta with shorttitle.json", "w", encoding="utf-8") as f:
json.dump(data, f, ensure_ascii=False, indent=4)

Which only adds an entry to the "short title", leaving everything else as was. Now, when I import this changed metadata (trialed on a small amount of entries, as to not break the whole library) to Zotero, this creates duplicates next to the original entries every single time, which have to be merged by hand. I was wondering if I was doing something wrong, or if there is no way to merge such entries automatically?

Best wishes and thank you in advance!
  • You can't export/import while keeping identifiers; you'll want to do this via the API.
  • You think pyzotero would help? I am pretty new to all this and always just used vanilla zotero, so I never had to interact with the API.
  • edited yesterday at 10:56pm
    Yes definitely. I believe the pyzotero developer has actually released a claude code skill that lets you interact with zotero locally using pyzotero. That is, of course if you're interested in going the AI route.

    (To be clear, of course you don't need to use AI, it will just likely make it faster if you're not interested in picking up the API skills)
  • Thank you! AI is sometimes helpful for me as a beginner (as it gives me ideas on whaf to try), but it tries to feed me so much absurd information I prefer to learn the tools directly from the documentation. In any case, I will check out the Claude tool, haven't seen it yet.
Sign In or Register to comment.