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 |
|---|---|
|
Python package name (defaults to project_name) |
|
Authorβs name |
|
Authorβs email |
|
GitHub username |
|
Initial version number |
|
Short project description |
|
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 |
|
|
UV |
hatchling |
|
|
# 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
GitHub Repository Setupο
The following options are available to setup a github repository for the project:
Option |
Description |
|---|---|
|
Create a private github repository for the project |
|
Create a public github repository for the project |
|
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.