A flexible and reusable Cookiecutter template to kickstart your Python projects with best practices, pre-configured tools, and a modular structure. Perfect for building apps, APIs, or utilities without starting from scratch every time.
- Modular Structure: Organized folders and files for clean, maintainable projects.
- Pre-Configured Logging: Includes rotating file handlers and colorful console output using
colorlog
. - Environment Management: Supports
.env
files withpython-dotenv
. - Versioning System: Easy version bumping with
bump-my-version
. - Cookiecutter Customization: Dynamically set project name, author, version, and more during initialization.
Ensure you have Cookiecutter installed. If not, install it using pip:
pip install cookiecutter
Run Cookiecutter and point it to your template repository:
cookiecutter https://github.com/<your-username>/python-project-template
Cookiecutter will ask for details to personalize your project. Example prompts:
project_name
: The name of your project (e.g.,awesome_project
).author_name
: Your name (e.g.,Jake Peralta
).version
: The starting version (e.g.,0.1.0-alpha
).description
: A short description of your project.
After running Cookiecutter, your new project will be ready to go: awesome_project/ │ ├── PROJECT_NAME/ │ ├── init.py │ ├── version.py │ └── utils/ │ ├── logger.py │ └── ... ├── requirements.txt ├── README.md ├── .gitignore ├── LICENSE
Pre-configured logging with:
- Rotating file handlers.
- Colorful console logs (via
colorlog
). - Easy toggling between console and file logs.
Supports .env
files for managing secrets like API keys. Simply create a .env
file:
OPENAI_API_KEY=your-api-key
Easily bump versions using bump-my-version
. Example:
bump-my-version bump prerelease
bump-my-version release
Make sure the following libraries are installed:
colorlog
python-dotenv
bump-my-version
Install them with:
pip install -r requirements.txt
This template is licensed under the MIT License. Feel free to use it, modify it, and distribute it as you wish.