Pyzotero: a Python client for the Zotero API pyzotero.readthedocs.io
zotero
at main 751 B view raw
1import httpx 2 3url = "https://api.github.com/repos/urschrei/pyzotero/contributors" 4result = httpx.get(url) 5result.raise_for_status() 6contributors = result.json() 7# filter out dependabot and meeee 8as_dict = [ 9 contributor 10 for contributor in contributors[1:] 11 if not contributor["login"].lower().startswith("dependabot") 12] 13header = "# This is the list of people (as distinct from [AUTHORS](AUTHORS)) who have contributed code to Pyzotero.\n\n| **Commits** | **Contributor**<br/> |\n| --- |--- |\n" 14template = "| {contributions} | [{login}](https://github.com/urschrei/pyzotero/commits?author={login}) |\n" 15with open("CONTRIBUTORS.md", "w", encoding="utf-8") as f: 16 f.write(header) 17 f.writelines(template.format(**dct) for dct in as_dict)