Skip to content

Commit

Permalink
MRG: add pyproject->zenodo script and file (#3209)
Browse files Browse the repository at this point in the history
This PR adds a script to extract the authors from `pyproject.toml` and
write them to `.zenodo.json`, and adds the resulting `.zenodo.json`.

ref #3111 and
openjournals/joss-reviews#6830 (comment)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ctb and pre-commit-ci[bot] authored Jun 10, 2024
1 parent 4c840c5 commit d7ea4b9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"creators": [{"name": "Luiz Irber", "orcid": "0000-0003-4371-9659"}, {"name": "N. Tessa Pierce-Ward", "orcid": "0000-0002-2942-5331"}, {"name": "Mohamed Abuelanin", "orcid": "0000-0002-3419-4785"}, {"name": "Harriet Alexander", "orcid": "0000-0003-1308-8008"}, {"name": "Abhishek Anant", "orcid": "0000-0002-5751-2010"}, {"name": "Keya Barve", "orcid": "0000-0003-3241-2117"}, {"name": "Colton Baumler", "orcid": "0000-0002-5926-7792"}, {"name": "Olga Botvinnik", "orcid": "0000-0003-4412-7970"}, {"name": "Phillip Brooks", "orcid": "0000-0003-3987-244X"}, {"name": "Peter Cock", "orcid": "0000-0001-9513-9993"}, {"name": "Daniel Dsouza", "orcid": "0000-0001-7843-8596"}, {"name": "Jade Gardner", "orcid": "0009-0005-0787-5752"}, {"name": "Laurent Gautier", "orcid": "0000-0003-0638-3391"}, {"name": "Tim Head", "orcid": "0000-0003-0931-3698"}, {"name": "Mahmudur Rahman Hera", "orcid": "0000-0002-5992-9012"}, {"name": "Hannah Eve Houts", "orcid": "0000-0002-7954-4793"}, {"name": "Lisa K. Johnson", "orcid": "0000-0002-3600-7218"}, {"name": "Fabian Kl\u00f6tzl", "orcid": "0000-0002-6930-0592"}, {"name": "David Koslicki", "orcid": "0000-0002-0640-954X"}, {"name": "Katrin Leinweber", "orcid": "0000-0001-5135-5758"}, {"name": "Marisa Lim", "orcid": "0000-0003-2097-8818"}, {"name": "Ricky Lim", "orcid": "0000-0003-1313-7076"}, {"name": "Bradley Nelson", "orcid": "0009-0001-1553-932X"}, {"name": "Ivan Ogasawara", "orcid": "0000-0001-5049-4289"}, {"name": "Taylor Reiter", "orcid": "0000-0002-7388-421X"}, {"name": "Camille Scott", "orcid": "0000-0001-8822-8779"}, {"name": "Andreas Sj\u00f6din", "orcid": "0000-0001-5350-4219"}, {"name": "Connor T. Skennerton", "orcid": "0000-0003-1320-4873"}, {"name": "Jason Stajich", "orcid": "0000-0002-7591-0020"}, {"name": "Daniel Standage", "orcid": "0000-0003-0342-8531"}, {"name": "S. Joshua Swamidass", "orcid": "0000-0003-2191-0778"}, {"name": "Connor Tiffany", "orcid": "0000-0001-8188-7720"}, {"name": "Pranathi Vemuri", "orcid": "0000-0002-5748-9594"}, {"name": "Erik Young", "orcid": "0000-0002-9195-9801"}, {"name": "Nick H", "orcid": "0000-0002-1685-302X"}, {"name": "C. Titus Brown", "orcid": "0000-0001-6001-2677"}]}
32 changes: 32 additions & 0 deletions utils/toml-to-zenodo-json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#! /usr/bin/env python
import sys
import argparse
import tomllib
import pprint
import json


def main():
p = argparse.ArgumentParser()
p.add_argument("toml_file")
p.add_argument("-o", "--output-json", required=True)
args = p.parse_args()

with open(args.toml_file, "rb") as fp:
d = tomllib.load(fp)

# pprint.pprint(d)
out_d = {}

creators = []
for author_d in d["project"]["authors"]:
creators.append(author_d)

out_d["creators"] = creators

with open(args.output_json, "w") as fp:
json.dump(out_d, fp)


if __name__ == "__main__":
sys.exit(main())

0 comments on commit d7ea4b9

Please sign in to comment.