Closed hbshrestha closed 2 years ago
Top-level items e.g. articles with attachments have a numChildren
key which will tell you how many child items they have. You can retrieve children using zot.children(itemKey)
. The returned items contain extensive metadata in their links
key, including MIME type and href. That would be the first place I would look for information pertaining to Dropbox. However, I've never used Zotero with a third-party storage service so I don't know if this is the correct key.
Regarding changing the link, I don't know whether that's possible or whether you'll have to add a new child item, pointing to the new attachment you've stored in Zotero, to the parent, then delete the "stale" child. In general however, the process can certainly be automated. The forums are the best place to ask about how best to do this: https://forums.zotero.org
Thank you for your prompt response!
I see that there is mention of numChildren
in item["meta"]
.
However, I get the following error message when I tried to retrieve children using
zot.children(item)
orzot.children(all_items)
or even zot.children(item["meta"]
. I am not sure where I can find the itemKey
. Could you possible elaborate?
AttributeError: 'dict' object has no attribute 'upper'
As per the docs, children
is called with a string
argument, which is the key
attribute of a retrieved item: https://pyzotero.readthedocs.io/en/latest/index.html?highlight=children#zotero.Zotero.children
Thank you! I could access the child item using
zot.children(item["key")
and I could access the url link to dropbox using
zot.children(item["key"])[0]["data"]["url"]
First of all, thank you for this great package. I have recently switched from Mendeley to Zotero, so I am relatively new to using it.
I have attached link to the copy of a file, which is in dropbox, as can be seen in the image below:
I am going to buy a professional version of Zotero soon. So I am going to migrate these attachment files from dropbox to the Zotero cloud. This means that the links to these files won't work any more, and they need to be updated.
I am able to access
all_items
from my Zotero library of group library_type using the following code:I am able to access the specific attributes of the specific item as follows:
This returns me the item attributes as shown below:
However, I don't find the link to the attached file in dropbox in these attributes returned. How can I access the link or the attributes of the attached file? I have thousands of files, and not all have attachments. For the files which have attachments, I want to change the link from dropbox to one in Zotero cloud when I purchase the Zotero professional.
Is it possible to automate this process? Thank you!