dependency-cite
Cite all of your software dependencies you use in your research
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.4%) to scientific vocabulary
Repository
Cite all of your software dependencies you use in your research
Basic Info
Statistics
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 6
- Releases: 0
Metadata Files
README.md
Python Package Citation Generator
This script automatically generates citations in BibTeX format for Python packages listed in a requirements.txt file. It fetches package details, including the GitHub repository (if available) and contributors, from PyPI and GitHub.
About this package
Currently, research software is undercited, and therefore underrecognized by researchers as a valuable output for science. There have been a lot of strides in the past few decades to changing this, running from the software format in Bibtex, to the CITATION.cff file that can be embedded in repositories, to linking software with DOIs and OrcidIDs on Zenodo, to publishing software on the Journal of Open Source Software.
However, there remains a problem of how to cite all software dependencies used in your research. Currently, most software citations are for charismatic, large projects that are high up the dependency chain, which the author wants to cite. "We used this package
To change this, I've started building a software suite that looks up the dependencies for the project you are using, and cites them. Ideally, it cites the packages using citation formats that the authors had intended to be cited - CITATION.cff files, Zenodo links, and so on. If not, it grabs the best guess of the authors of the package, and creates a new citation for that version.
This all came out of an idea that started at the ReSA funders workship in Montréal in September, 2023. I posted on the JOSS forum about my idea, here: Ask researchers to cite software they use before allowing publication in JOSS.
I have now coded a bit of the work, and hope to expand it futher. Contributions and thoughts would be most welcome.
Features
- Extract package names and versions from
requirements.txt. - Fetch package details and GitHub URLs from PyPI.
- Retrieve contributor information for the package from its GitHub repository.
- Generate BibTeX entries for each package and write them to
output.bib.
Prerequisites
- Python 3.6 or newer.
requestslibrary: Used to make API requests to PyPI and GitHub.
Install with:
bash
pip install requests
- A GitHub token: To avoid rate limits when accessing the GitHub API. Set it as an environment variable named
GITHUB_TOKEN.
Usage
- Ensure your
requirements.txtfile is in the same directory as the script. It should list packages with their versions, e.g.,
numpy==1.21.0
scipy==1.7.0
- Run the script:
bash
python script_name.py
Replace script_name.py with the actual name of the script.
- Check the generated
output.bibfile for BibTeX formatted citations.
Output Format
The script will generate citations in the following format:
@software{package_name,
author = {Author1 and Author2 and ...},
title = {Package Title},
url = {https://github.com/user/repo},
version = {version_number},
date = {publication_year},
}
Notes
- Packages without a linked GitHub repository or without an
==version specifier inrequirements.txtmight not be processed. - If the script encounters rate-limiting issues with GitHub's API, ensure you've set the
GITHUB_TOKENenvironment variable with a valid GitHub token.
Contributing
If you'd like to contribute to this project, please open an issue or submit a pull request.
License
MIT.
Owner
- Name: Richard Littauer
- Login: RichardLitt
- Kind: user
- Location: Pōneke Wellington, Aotearoa New Zealand
- Company: @sustainers
- Website: https://burntfen.com
- Repositories: 761
- Profile: https://github.com/RichardLitt
Open source maintainer, birder, sailor, poet, linguist, flâneur, etc, etc, etc.
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: dependency-cite
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Richard
family-names: Littauer
email: richard.littauer@gmail.com
affiliation: Unaffiliated
orcid: 'https://orcid.org/0000-0001-5428-7535'
repository-code: 'https://github.com/RichardLitt/dependency-cite/'
abstract: 'Cite all of your software dependencies in your work. '
keywords:
- citation
- cite
- open-science
license: MIT
GitHub Events
Total
Last Year
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Richard Littauer | r****b@b****m | 4 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 6
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 2.17
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- RichardLitt (6)