Simple Python script to request Zenodo through its web API for recognizing pre-existing releases of GitHub based projects when they have only been added to Zenodo after a release (or multiple) has been published to GitHub.
- Create a new virtual environment (e.g.
vf new zenodo
when using virtualfish) - Activate the virtual environment if necessary (virtualfish does it automatically)
Then install the requirements by running:
pip install --upgrade --requirement requirements.txt
Assuming you'll try to generate Zenodo DOIs for a project (repository) called
awesomeproject
that is located in the GitHub organization
exampleorg
:
- Create a settings file by copying the
settings/example.yml
to a new one, saysettings/awesomeproject.yml
- Adjust the
repo
field to readexampleorg/awesomeproject
- Use a web browser and navigate to https://github.com/exampleorg/awesomeproject/settings/hooks
- Hit the
Edit
button next to the Zenodo webhook - From the
Payload URL
field copy the last part (everything afteraccess_token=
) - Place that string in the
token
entry of the newly copied settings file - Save the new settings file
Finally, run the script by specifying the path to the new settings file:
python update-zenodo.py settings/awesomeproject.yml