A Python project generator using cookiecutter templates
Project description
Generate Project
A Python project folder generator based on Poetry for dependency and package management. The generated folder provides everything you need to get started with a well-structured Python project, including formatting, linting, documentation, testing, and CI/CD integration.
Features
๐ฆ Poetry 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 for 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
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_version="3.11"
...
Project Configuration Options
These are the most important project configuration options:
| Option | Description |
|---|---|
project_name |
Name of the project |
package_name |
Python package name (importable) |
author_name |
Author's name |
email |
Author's email |
github_username |
GitHub username |
version |
Initial version number |
description |
Short project description |
python_version |
Python version requirement |
Advanced Usage
You can also save your configuration values to be used as default values:
generate-project config \
author_name="Your Name" \
email="your.email@example.com" \
github_username="yourusername" \
python_version="3.11"
and the you can omit the saved configuration options:
generate-project generate "project-name"
...
Project Structure
The generated project will have the following structure:
project-name/
โโโ .github/workflows/ # GitHub Actions CI/CD
โ โโโ docs.yml # Documentation building and testing
โ โโโ tests.yml # Code quality and testing
โ โโโ release.yml # Automated releases
โ โโโ update_rtd.yml # ReadTheDocs updates
โโโ 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 suite
โโโ scripts/ # Development scripts
โโโ .gitignore # Git ignore rules
โโโ .readthedocs.yaml # ReadTheDocs configuration
โโโ 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 |
|---|---|
--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 workflow |
The following repository secrets can be automatically setup:
TEST_PYPI_TOKEN
PYPI_TOKEN
RTD_TOKEN
The tokens must be available in a .env file found in the folder where generate-project is executed or increasingly higher folders.
Development Workflow
The generated project includes a Makefile with common development tasks:
# Install dependencies
make install # Install main dependencies
make install-dev # Install all development dependencies
# Code quality
make format # Run code formatters
make lint # Run linters
# Testing
make test # Run tests
make test-cov # Run tests with coverage
# Documentation
make docs # Build documentation
make docs-live # Start live preview server
make docs-api # Generate API docs
# Releasing
make build # Build package locally
make publish # Publish to PyPI a package generate locally
make release-minor # Create a new release and bump the version
Run make help for a complete list of the make targets available.
Customization
You can customize this template by:
- Forking the repository
- Modifying files in the template structure base on cookiecutter
- Updating cookiecutter.json with your preferred defaults
License
This project template 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.0.2.post1.tar.gz.
File metadata
- Download URL: generate_project-1.0.2.post1.tar.gz
- Upload date:
- Size: 36.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeeda073a2332c5d00beabd7da03638c3dd564cb75d3f9e1ba3e6a75538fc834
|
|
| MD5 |
d3552ec05c204c381d96479b4302ac50
|
|
| BLAKE2b-256 |
791c754eb3651e24f112321b85ccc6c49e16a6d9bfdd342a2b1a4e56f951f53d
|
File details
Details for the file generate_project-1.0.2.post1-py3-none-any.whl.
File metadata
- Download URL: generate_project-1.0.2.post1-py3-none-any.whl
- Upload date:
- Size: 46.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
255c6e8a087f2e9645170df01130cc0cab1d670a08ae1dd4ef23543092f903d7
|
|
| MD5 |
a7ff0e9409a3b772b2b36b48407f5274
|
|
| BLAKE2b-256 |
fb0f7e2b25b69d6903230765ccd97ee57f6abf5204c67c865f6f0732c07fdc32
|