Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Netherlands eScience Center Python Template

License

NotificationsYou must be signed in to change notification settings

NLeSC/python-template

Python Template logo, created using ChatGPT 4o on 10 September 2024 using prompt "generate a logo of a copier that looks like a snake-scientist"

Spend less time setting up and configuring your new Python packages by using this template. ThisCopier template includes best practices for research software so your new package will include these practices from the start.

You can choose from various user profiles, each offering a range of features to suit your needs.

User profiles

The template profiles for a Python package offer varying levels of customization to cater to different user needs. Below are the profiles the template offers.

Minimum

This profile offers the essential features to begin developing a Python package, making it ideal for first-time research software developers. Additional features can be added as needed.

Recommended

This option provides a pre-selected set of features for research software, which users can fully customize.

Let me choose

This fully customizable profile enables you to selectively include or exclude features in your Python package.

Features

Badges

fair-software.nl recommendations
(1/5) code repositorygithub repo badge
(2/5) licensegithub license badge
(3/5) community registryRSD
(4/5) citationDOI
(5/5) checklist 
overallfair-software badge
Other best practices 
  
GitHub Actions 
Citation metadata consistencycffconvert
Link checkerlink-check
Teststests

How to use

There are multiple scenarios to use this template:

  • Scenario 1: Generating a new package using template
  • Scenario 2: Applying the template to some pre-existing code
  • Scenario 3: Updating a package made with the template

In all three scenarios, you will need to install Copier first, which werecommend doing withpipx:

python3 -m pip install --user pipxpython3 -m pipx ensurepathpipx install copier

Note

Note that it is also possible to install Copier with regularpip, but thatCopier will then be installed in your common environment and may causeconflicts with its dependencies, whilepipx will install Copier in aseparate and dedicated environment.

Scenario 1: Create a new package

Runcopier copy with the template:

copier copy https://github.com/nlesc/python-template.git path/to/destination

Note

  1. Make sure thatpath/to/destination is an empty directory
  2. Based on the profile and selected features, the package will be generated in the specified destination directory

For an explanation of what's there, read on in theproject_setup.md file.

Scenario 2: Apply to pre-existing code

To apply the template to pre-existing code, you can use the samecopier copycommand as when creating a new package, except that you point to the foldercontaining your existing code rather than a new one:

copier copy https://github.com/nlesc/python-template.git path/to/existing/code

This works because ifpath/to/destination already exists, Copier willupdate what is already there by either adding new files or updatingexisting files. Copier will ask to overwrite any files that resulted inconflicts. Especially if your files are already under version control, it isrecommended to answer 'yes' for all files, you will still be able to reviewthe changes suggested by the template.

Scenario 3. Updating a template-made package

Copier provides the functionality for re-applying the template to a previouslycreated project using thecopier update command. This has two effects:

  1. Your project will be updated according to the latest version of the template
  2. You can change any of your previous answers to apply these changesthroughout your entire project.

Caution

Do not manually update answers in.copier-answers.yml,as it will result in unexpected behavior.

cd path/to/projectcopier update

If you don't want to change any of your answers, but only want to update yourproject according to the latest template updates, you can provide the--skip-answered option. This tells Copier to reuse all of your previousanswers, and simply bring in all updates from the template intoyour current project, such as updating which Python versions are supported.You will still be asked to answer any new questions that have been added tothe template since you last applied it.

copier update --skip-answered

Examples

Many developers have gone before you in using this template to get started quickly. Check out their projects in thelist below:

  1. Cerise:https://github.com/MD-Studio/cerise
  2. cerulean:https://github.com/MD-Studio/cerulean
  3. cffconvert:https://github.com/citation-file-format/cff-converter-python
  4. fairtally:https://github.com/fair-software/fairtally
  5. howfairis:https://github.com/fair-software/howfairis
  6. matchms:https://github.com/matchms/matchms
  7. MUSCLE 3:https://github.com/multiscale/muscle3
  8. pycff:https://github.com/citation-file-format/pycff
  9. spec2vec:https://github.com/iomega/spec2vec
  10. yatiml:https://github.com/yatiml/yatiml
  11. ... And many more (seethis discussion). Make a PR to add your project here, or simply ping us in an issue!

How to contribute

Suggestions/improvements/edits are most welcome. Please read thecontribution guidelines before creating an issue or a pull request.


[8]ページ先頭

©2009-2025 Movatter.jp