PKM-er / obsidian-zotlit

A third-party project that aims to facilitate the integration between Obsidian.md and Zotero, by providing a set of community plugins for both Obsidian and Zotero.
https://zotlit.aidenlx.top
MIT License
664 stars 29 forks source link

Feature: API to access Zotero DB #82

Open stefanopagliari opened 2 years ago

stefanopagliari commented 2 years ago

Thank you for this great plugin. The integration with the Zotero DB in the Zotero Plugin works great. As mentioned in Discord it would be helpful (at least for me but I'm sure also for others) if you considered introducing an API or some other mechanism to allow other plugins to read the Zotero DB. Thanks

stefanopagliari commented 1 year ago

@aidenlx sorry to bother you about this. I was wondering if you could provide any suggestion on how it could be possible to read the Zotero DB from another plugin. My attempts to integrate sqlite into my plugin have hit a wall

aidenlx commented 1 year ago

Sorry for the long wait! The next major update obsidian plugin will arrive in two week or so. I've been busy with the work and refactoring the plugin. Can you first try describe the needs for the API?

could provide any suggestion on how it could be possible to read the Zotero DB from another plugin

I'm using a custom build of better-sqlite3, and download binaries for the github release based on machine's architecture. I've put database instance inside worker so that reading db won't block UI. The core logic for init database instance can be found here, Although I still recommend you to use API exposed from this plugin in next version:

https://github.com/aidenlx/obsidian-zotero/blob/dev/lib/db-worker/src/database.ts

FeralFlora commented 1 year ago

@stefanopagliari The update is out now!

stefanopagliari commented 1 year ago

@aidenlx @MSBack Thank you for this. Sorry for not seeing before your message from February 20. Ideally I would like a way for other plugins to be able to run searches on the Zotero DB once your plugin is installed and activated.

FeralFlora commented 1 year ago

Ideally I would like a way for other plugins to be able to run searches on the Zotero DB once your plugin is installed and activated.

Isn't that what this new update (1.0.0) does? The changelog says:

forward API to global window property zoteroAPI for other plugins to use.

aidenlx commented 1 year ago

the search function is not yet available, and currently available APIs is listed in here: https://obzt.aidenlx.top/reference/api/interfaces/PluginAPI

FeralFlora commented 1 year ago

Hey @aidenlx, is the Zotlit API still available? The documentation link above is dead, and I can't find anything about it in the new docs. I am interested in using the API to develop a plugin that provides some Zotero related workflows.

aidenlx commented 1 year ago

Yes, it's still there, it's just that I haven't migrate that part to new docs. I'll see if API doc generation is still feasible in new document framework.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

FeralFlora commented 1 year ago

Yes, it's still there, it's just that I haven't migrate that part to new docs. I'll see if API doc generation is still feasible in new document framework.

Will you give an update here when the API docs are back?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

FeralFlora commented 1 year ago

Bump

FeralFlora commented 11 months ago

Any update on the Zotlit API?