Skip to content

Commit 248c5c3

Browse files
committed
Make auto-generated citation file
1 parent 9d7096d commit 248c5c3

3 files changed

Lines changed: 26 additions & 9 deletions

File tree

cookiecutter.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"repository_name": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
77
"module_name": "{{cookiecutter.repository_name}}",
88
"project_short_description": "Tools ensuring reproducible and standarized Python packaging.",
9+
"orcid": "ABCD-ABCD-ACBD-ABCD",
910
"version": "0.1.0",
1011
"linting": "y",
1112
"testing": [

docs/options.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ The following options are available when using the cookiecutter:
77
4. __project\_name__: Used in various headers of the documentation
88
5. __repository\_name__: Name of the repository
99
6. __package\_name__: Name of the python package.
10-
7. __project\_short\_description__: Usin in `pyproject.toml`
11-
8. __version__: The initial version of the software.
12-
9. __linting__: Enable linting, i.e. [mypy](https://scientificcomputing.github.io/reproducibility/part1/typing.html) and [flake8](https://scientificcomputing.github.io/reproducibility/part1/linting.html). This also enables the "Check Formatting" Github action.
13-
10. __testing__: Choose testing framework. If not `none` it creates a test folder with an initial test. Also adds [optional installation dependencies](https://scientificcomputing.github.io/reproducibility/part1/packaging.html#optional-dependencies) to `pyproject.toml`. Creates a "Test Package" Github action. If `pytest-cov` is chosen, it adds settings to generate a coverage report and publsuh them as a [Github artifact](https://scientificcomputing.github.io/reproducibility/part1/coverage.html).
14-
10. __use\_argparse__: Makes it possible to run the package as `module_name` or `python -m module_name` with inputs from the command line.
15-
11. __build\_docs__: Build a webpage with documentation (including a package API).
16-
12. __use_pre_commit__: Set up [pre-commit hooks](https://pre-commit.com) that will run some tests every time you make a commit.
17-
13. __docker__: Adds a Dockerfile that includes the module (not including optional dependencies). Adds a [publishing workflow](https://scientificcomputing.github.io/reproducibility/part4/docker.html#github-packages).
18-
14. __open\_source\_license__: Choose a open source license for your code
10+
7. __project\_short\_description__: Using in `pyproject.toml`
11+
8. __orcid__: Your [ORCID](https://en.wikipedia.org/wiki/ORCID) identification number
12+
9. __version__: The initial version of the software.
13+
10. __linting__: Enable linting, i.e. [mypy](https://scientificcomputing.github.io/reproducibility/part1/typing.html) and [flake8](https://scientificcomputing.github.io/reproducibility/part1/linting.html). This also enables the "Check Formatting" Github action.
14+
11. __testing__: Choose testing framework. If not `none` it creates a test folder with an initial test. Also adds [optional installation dependencies](https://scientificcomputing.github.io/reproducibility/part1/packaging.html#optional-dependencies) to `pyproject.toml`. Creates a "Test Package" Github action. If `pytest-cov` is chosen, it adds settings to generate a coverage report and publsuh them as a [Github artifact](https://scientificcomputing.github.io/reproducibility/part1/coverage.html).
15+
12. __use\_argparse__: Makes it possible to run the package as `module_name` or `python -m module_name` with inputs from the command line.
16+
13. __build\_docs__: Build a webpage with documentation (including a package API).
17+
14. __use_pre_commit__: Set up [pre-commit hooks](https://pre-commit.com) that will run some tests every time you make a commit.
18+
15. __docker__: Adds a Dockerfile that includes the module (not including optional dependencies). Adds a [publishing workflow](https://scientificcomputing.github.io/reproducibility/part4/docker.html#github-packages).
19+
16. __open\_source\_license__: Choose a open source license for your code
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% set names = cookiecutter.full_name.split(' ') -%}
2+
{% set ns = namespace(given=names[0]) -%}
3+
{% for name in names[1:-1] -%}
4+
{% set ns.given = ns.given + " " + name-%}
5+
{% endfor -%}
6+
7+
cff-version: 1.2.0
8+
message: "If you use this software, please cite it as below."
9+
authors:
10+
- family-names: "{{names[-1]}}"
11+
given-names: "{{ns.given}}"
12+
orcid: "https://orcid.org/{{cookiecutter.orcid}}"
13+
title: "{{cookiecutter.project_name}}"
14+
version: "{{cookiecutter.version}}"
15+
date-released: {% now 'utc', '%Y-%m-%d' %}

0 commit comments

Comments
 (0)