A Python project generator using cookiecutter templates
Project description
Generate Project
A Python project folder generator with support for Poetry and UV package managers. The generated folder provides everything you need to get started with a well-structured Python project, including development tasks for formatting, linting, documentation, testing, and CI/CD.
Features
๐ฆ Poetry or UV for dependency management and packaging
๐งน Code quality tools including black, isort, flake8, mypy and pylint
๐ Sphinx based documentation with auto-generated API docs and live preview
โ
Testing framework with pytest and test coverage reports
๐ GitHub actions with CI/CD workflows for tests, documentation and release management
๐ PyPl package publishing automation with version control
๐ ReadTheDocs integration for hosting documentation
๐ Automated release process for versioning and publishing
๐ Project structure following best practices
Requirements
Python 3.10+
Cookiecutter 2.6.0+
PyYAML 6.0.0+
python-dotenv 1.1.0+
Installation
pip install generate-project
Or, if you use Poetry:
poetry add generate-project
Or, if you use UV:
uv add generate-project
Quick Start
Basic Usage
You can provide the project configuration values in the terminal command line:
generate-project generate "project-name" \
--author_name="Your Name" \
--email="your.email@example.com" \
--github_username="yourusername" \
--python_min_version="3.11"
...
Project Configuration Options
These are the most important project configuration options:
| Option | Description |
|---|---|
package_name |
Python package name (defaults to project_name) |
author_name |
Author's name |
email |
Author's email |
github_username |
GitHub username |
version |
Initial version number |
description |
Short project description |
python_min_version |
Minimum Python version |
Advanced Usage
You can also save your own configuration values to be used as default values:
generate-project config \
--author_name="Your Name" \
--email="your.email@example.com" \
--github_username="yourusername" \
--python_min_version="3.11"
You can also set the default package manager:
generate-project config --manager uv
and then you can omit the saved configuration options:
generate-project generate "project-name"
...
Package Manager
By default, generate-project creates projects using Poetry. Use the --manager flag to select UV instead:
| Manager | Build Backend | Dependency Format | Command |
|---|---|---|---|
| Poetry (default) | poetry-core | [tool.poetry.dependencies] |
--manager poetry |
| UV | hatchling | [dependency-groups] (PEP 735) |
--manager uv |
# Poetry project (default)
generate-project generate my-project
# UV project
generate-project generate my-project --manager uv
Project Structure
The generated project will have the following structure:
project-name/
โโโ .github/workflows/ # GitHub actions for CI/CD
โ โโโ docs.yml # Documentation building and testing
โ โโโ tests.yml # Code quality and testing
โ โโโ release.yml # Automated releases and publishing
โ โโโ update_rtd.yml # Manual ReadTheDocs updates
โโโ .vscode/ # VS Code configuration
โ โโโ settings.json # Editor settings, linting, formatting
โ โโโ launch.json # Debug configurations
โ โโโ tasks.json # Task definitions
โโโ docs/ # Sphinx documentation
โ โโโ api/ # Auto-generated API docs
โ โโโ guides/ # User guides
โ โโโ conf.py # Sphinx configuration
โ โโโ index.md # Documentation home
โโโ src/package_name/ # Source code
โ โโโ __init__.py # Package initialization
โโโ tests/ # Test directory
โโโ scripts/ # Release management scripts
โโโ .env # Environment variables (if --local-env used)
โโโ .gitignore # Git ignore rules
โโโ .readthedocs.yaml # ReadTheDocs configuration
โโโ CLAUDE.md # Claude Code integration guide
โโโ CredentialManagement.md # Token management documentation
โโโ LICENSE # MIT License
โโโ Makefile # Development commands
โโโ pyproject.toml # Project configuration
โโโ run.sh # Development task runner
โโโ README.md # Project documentation
Project Types
By default, generate-project creates an application project with a CLI entry point. Use the --library flag to create a library project instead:
# Create an application (default)
generate-project generate my-app
# Create a library
generate-project generate my-lib --library
| Project Type | CLI Entry Point | main.py | Use Case |
|---|---|---|---|
| Application | Yes | Yes | CLI tools, scripts |
| Library | No | No | Reusable packages, APIs |
GitHub Repository Setup
The following options are available to setup a github repository for the project:
| Option | Description |
|---|---|
--github |
Create a private github repository for the project |
--public |
Create a public github repository for the project |
--secrets |
Create repository secrets for the release management workflows |
The following repository secrets can be automatically setup:
TEST_PYPI_TOKEN
PYPI_TOKEN
RTD_TOKEN
The tokens must be available in a .env file located in the directory where generate-project is executed or in any parent directory up the folder hierarchy. If no .env file is found, the application falls back to reading the tokens from environment variables.
Development Workflow
The generated project includes a Makefile with common development tasks:
# Environment Setup
make venv # Create and activate a local virtual environment
make install # Install core dependencies
make install-dev # Install all development dependencies
# Code quality
make format # Run code formatters
make lint # Run linters
make check # Run format + lint + tests on all files
make pre-commit # Run format and lint only on changed files, then tests
# Testing
make test # Run tests
make test-cov # Run tests with coverage
make coverage # Generate coverage report
# Documentation
make docs-api # Generate API documentation
make docs # Build documentation
make docs-live # Start live preview server
# Release tasks will bump the version, create a new release and publish it
make release-major # Create major release
make release-minor # Create minor release
make release-micro # Create micro (patch) release
make release-rc # Create release candidate
make release-beta # Create beta pre-release
make release-alpha # Create alpha pre-release
Run make help for a complete list of the development tasks available.
Acknowledgments
This project was inspired by the GitHub workflows and automation ideas from phitoduck/python-course-cookiecutter-v2.
While this project is an independent implementation and a full Python application, the original repository provided valuable inspiration for the CI/CD and automation approach.
We thank the original authors for their contributions and ideas.
License
This project is released under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file generate_project-1.3.0.tar.gz.
File metadata
- Download URL: generate_project-1.3.0.tar.gz
- Upload date:
- Size: 81.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a98ce3680b2c14675965c19b941931fbcf575d93b685cb442f6d454a2fee708b
|
|
| MD5 |
5669e8e69922f586eb1c739e1e838e63
|
|
| BLAKE2b-256 |
e822fe831b51b315d35736b6356f2c0c16e2babbceb6e31f1c98a620aab8fd63
|
File details
Details for the file generate_project-1.3.0-py3-none-any.whl.
File metadata
- Download URL: generate_project-1.3.0-py3-none-any.whl
- Upload date:
- Size: 106.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c288f1f7c6f09706933ccab19ae557c574bdee6c604a6d6d4de5fba1c778b92
|
|
| MD5 |
3c62aa1ee1a2301699ae920c394f674e
|
|
| BLAKE2b-256 |
3aa757798b2981b97920dcbdee79f6c12bc4bb56cc8b1a7bdc3253ce7a56cca9
|