Tool that helps in the creation of python projects.
PythonProjectBootstrapper
creates a python project that adheres to modern best practices for python package development. It also generates Continuous Integration / Delivery / Deployment workflows that maximize the free functionality offered by GitHub for open-source solutions.
- Simple local development through
Build.py
(see DEVELOPMENT.md for more information) - Python bootstrapping via PythonBootstrapper
- Source code formatting via black
- Static source analysis via pylint
- Test execution via pytest
- Code coverage extraction via coverage
- Semantic version generation via AutoGitSemVer
- Python wheel creation
- Wheel deployment to PyPi
- Executable generation via cx_Freeze
- Full Continuous Integration, Continuous Delivery, and Continuous Deployment (via GitHub Actions) for everything listed above
- GitHub Recommended Community Standards documentation
- GitHub pull request template
- GitHub issue templates
- [Optional] Build artifact signing via Minisign
- [Optional] Participation in the Open Source Security Foundation (OpenSSF) Best Practices Badge Program
- [Optional] Generation of development environment docker images in support of FAIR principles
Please see DEVELOPMENT.md for information on the generated content and how to make common modifications to that content.
From a terminal window, run one of the commands below. You will be asked a series of questions when generating a python project, then guided through configuration activities to ensure that the project is ready for use.
Scenario | Command Line | Output |
---|---|---|
Create a project for a python package | PythonProjectBootstrapper package <output_dir> |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Python Package ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β This project creates a Python package hosted on GitHub that uploads a Python wheel to PyPi. It also includes opt-in functionality to create docker images that ensure the exact β β reproducibility of all commits (which is especially useful for scientific software). β β β β If you continue, you will be asked a series of questions about your project and given step-by-step instructions on how to set up your project so that it works with 3rd party β β solutions (GitHub, PyPi, etc.). β β β β The entire process should take about 20 minutes to complete. β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Β Enter 'yes' to continue or 'no' to exit: |
Display Help | PythonProjectBootstrapper --help |
Β Usage: PythonProjectBootstrapper [OPTIONS] PROJECT:{package} OUTPUT_DIR Β ββ Arguments ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β * project PROJECT:{package} Project to build. [default: None] [required] β β * output_dir DIRECTORY Directory to populate. [default: None] [required] β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ Options ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β --configuration FILE Filename that contains template configuration values; see https://cookiecutter.readthedocs.io/en/stable/advanced/user_config.html for more β β info. β β [default: None] β β --replay Do not prompt for input, instead read from saved json. β β --yes Answer yes to all prompts. β β --skip-prompts Do not display prompts after generating content. β β --version Display the current version and exit. β β --install-completion Install completion for the current shell. β β --show-completion Show completion for the current shell, to copy it or customize the installation. β β --help Show this message and exit. β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
Version | PythonProjectBootstrapper --version |
PythonProjectBootstrapper v0.2.0 |
There are other tools available that offer similar functionality, each emphasizing different domains, conventions, or workflows. They are listed here in the event that one of them is a better fit for the specifics of your scenario.
Tool | Description |
---|---|
Scientific Python: guide, cookie, & sp-repo-review | A copier/cookiecutter template for new Python projects based on the Scientific Python Developer Guide. |
cookiecutter-cms | A cookiecutter template for those interested in developing computational molecular packages in Python. |
LINCC Frameworks Python Project Template | This project template codifies LINCC-Framework's best practices for python code organization, testing, documentation, and automation. |
Cookiecutter Django | Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly. |
cookiecutter-pylibrary | Enhanced cookiecutter template for Python libraries. |
repo-scaffolder | Templates and commandline tools for creating repositories for US Federal open source projects |
PythonProjectBootstrapper uses cookiecutter as its underlying templating engine, but others are available within python. Some are listed here if you want to use them directly.
Tool | Description |
---|---|
cookiecutter | A cross-platform command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, C projects. |
copier | A library and CLI app for rendering project templates. |
PythonProjectBootstrapper can be installed via one of these methods:
Download an executable for Linux, MacOS, or Windows to use the functionality provided by this repository without a dependency on Python.
- Download the archive for the latest release here; the files will begin with
exe.
and contain the name of your operating system. - Decompress the archive
Executables are signed and validated using Minisign.
The public key for executables in this repository is RWRkzrG0tznlEpemQ9U4aCQU/TO1TXipqycs7G9pRrm/9ab9HBcV/EIf
.
To verify that the executable is valid, download the corresponding .minisig
file here and run this command, replacing <filename>
with the name of your file.
docker run -i --rm -v .:/host jedisct1/minisign -V -P RWRkzrG0tznlEpemQ9U4aCQU/TO1TXipqycs7G9pRrm/9ab9HBcV/EIf -m /host/<filename>
Instructions for installing docker are available at https://docs.docker.com/engine/install/.
Install the PythonProjectBootstrapper package via pip (Package Installer for Python) to use it with your python code.
pip install PythonProjectBootstrapper
Please visit Contributing and Development for information on contributing to this project.
Additional information can be found at these locations.
Title | Document | Description |
---|---|---|
Code of Conduct | CODE_OF_CONDUCT.md | Information about the the norms, rules, and responsibilities we adhere to when participating in this open source community. |
Contributing | CONTRIBUTING.md | Information about contributing code changes to this project. |
Development | DEVELOPMENT.md | Information about development activities involved in making changes to this project. |
Governance | GOVERNANCE.md | Information about how this project is governed. |
Maintainers | MAINTAINERS.md | Information about individuals who maintain this project. |
Security | SECURITY.md | Information about how to privately report security issues associated with this project. |
PythonProjectBootstrapper is licensed under the MIT license.