AccelerationConsortium / awesome-self-driving-labs

A community-curated list of resources related to self-driving labs which combine hardware automation and artificial intelligence to accelerate scientific discovery.
Creative Commons Zero v1.0 Universal
121 stars 19 forks source link

Generate BibTeX from DOIs #10

Closed stefanbringuier closed 1 year ago

stefanbringuier commented 1 year ago

I'm using this repo list extensively for my references, but want to be able to continuously update my Zotero library from this list using a .bib file. This is my approach, but I'm sure better and more streamlined implementations can be devised. Maybe it's useful for others, but if you think it clutters the tree up, feel free to reject.

Changes Made

Introduces the bibtex/generate_bibtex.py script to the repository. This script serves to create a BibTeX bibliography from the DOI's in the readme.md file.

Description of the generate_bibtex.py script

The generate_bibtex.py script performs the following functions:

  1. Reads DOI's from readme.md and request BibTeX entry from server.
  2. Writes BibTeX entries into bibtex/references.bib file.

GitHub Action Integration

Introduced job run-script in .github/workflow/references.yml which is set to execute upon a push to the main branch. The job includes the GitHub action Add & Commit for the file bibtex/references.bib. This requires workflow read and write permissions.

Limitations

sgbaird commented 1 year ago

I'm using this repo list extensively for my references

So glad to hear this! 😄

but want to be able to continuously update my Zotero library from this list using a .bib file.

This is very timely! I was thinking about this just recently. I pulled most of these references from one of my Zotero group folders for a community review of low-cost SDLs. I changed this to "Public Closed" just now, so you should be able to view it.

This is my approach, but I'm sure better and more streamlined implementations can be devised. Maybe it's useful for others, but if you think it clutters the tree up, feel free to reject.

I was thinking about the following (with some of the pieces that were missing inspired by your PR):

It looks like the Zotero API can access group folders ("User and Group Library URLs" section) and also initiate write requests. This could be done manually by adding the reference to the Zotero folder via the Zotero desktop app or programmatically via a GitHub action that uses the Zotero API to add new entries after a PR is merged.

I like your approach. It's already working and runs autonomously like SDLs 😉. Maybe in the future, we can do something with the Zotero group folder option.

I don't think the bibtex folder clutters the tree. If you think it would be better, I would be okay with the files being at the top level to make references.bib directly visible. Current organization is fine by me, too. Updating the README to mention the references.bib file is easy enough.

Also, thank you for the clear summary of this PR!

Lmk what you think of my requested changes.

sgbaird commented 1 year ago

For later, I took a quick stab at making a Zotero group folder that mirrors the structure: https://www.zotero.org/groups/5078606/awesome-self-driving-labs

stefanbringuier commented 1 year ago

For later, I took a quick stab at making a Zotero group folder that mirrors the structure: https://www.zotero.org/groups/5078606/awesome-self-driving-labs

This is great for me!

auto-export the .bib file to a Google Drive file

Does the Zotero API let you export .bib for group folders? If so, then might not need this step.

sgbaird commented 1 year ago

Does the Zotero API let you export .bib for group folders? If so, then might not need this step.

Good point! I'll check.

sgbaird commented 1 year ago

Looks like it's supported (read requests section):

https://www.zotero.org/support/dev/web_api/v3/basics#export_format

sgbaird commented 1 year ago

Thanks for the great contribution!

stefanbringuier commented 1 year ago

Sure no problem. It looks like the git action for add and commit may be failing, this requires change the read and write permissions for the repo to enable. https://github.com/ad-m/github-push-action/issues/96#issuecomment-889984928.

I'm seeing your issue #13 now.

sgbaird commented 1 year ago

@stefanbringuier thanks for linking that! Adjusting settings per the image in the linked comment was straightforward.

sgbaird commented 1 year ago

Success: https://github.com/sgbaird/awesome-self-driving-labs/actions/runs/5140872935