Hi,
I'd like to build a script for working with the contents in my Zotero library. What I am looking for is for ways to read the information in the library from a local program / custom script.
My attempts so far:
1. The export from the UI seems usable, especially the CSV one seems to have all the information in a very accessible format. Is there a way to export such a file by executing a command line tool? Or to configure Zotero in a way to export one regularly automatically?
2. I could also query Zoteros sqlite3 database. I just tried to build a query to fetch the records and this seems doable ([1] example query). The problem is, when Zotero is running, the database is locked so not even read-only access is allowed. I want to be able to fetch the information with Zotero running. Sqlite3 seems to have a shared mode for that[2], where other processes are allowed to read. Is there a way to configure Zotero in a way to use that mode so the database can be accessed?
I guess it's pretty special inquiry, but it would be super neat if I could access my Zotero library and build custom tools around it. Thanks for any hints for making that happen,
Greetings,
Ralf
------------
[1]
select
itemId,
key,
(select typename from itemTypes where itemTypes.itemTypeID=items.itemTypeID) as type, (select value from itemDataValues where valueID = (select valueID from itemData where itemID=items.itemID and fieldID=(select fieldID from fields where fieldName="title"))) as title,
(select itemId is not null from deletedItems where deletedItems.itemID=items.itemID) as deleted
from items
where
deleted is null
and type!='attachment'
and type!='note';
[2]
https://www.sqlite.org/lockingv3.html