pyrig is a python toolkit that rigs up your project by standardizing and automating project setup, configuration and maintenance
pyrig is a package and tool that scaffolds and initializes a complete, fully configured, installed and working python project with one command and makes the process of developing and maintaining it more seamless and efficient by automating things like configuration management, CLI generation, testing infrastructure, and more.
- Python 3.12+
- Git
- uv
uv init
uv add pyrig
uv run pyrig initSee the Getting Started Guide for detailed setup instructions to also fully integrate with GitHub and CI/CD from the start.
pyrig init generates a complete project in one command that works out of the box.
This includes everything a modern python project needs:
- Standardized directory structure
- Fully configured dev tools (linters, formatters, type checkers, test frameworks, git hooks, etc.)
- End-to-end CI/CD pipeline with GitHub Actions and integrated repository protection
- Complete and working CLI
- And much more...
Every generated file is backed by a Python class that validates and merges
automatically. Override any config by subclassing, or define entirely new
config files — pyrig discovers and manages them for you.
Run pyrig mkroot to create or update all config files at once.
Run pyrig subcls to generate a subclass for overriding a specific file.
pyrig init sets up a CLI for your project that works immediately.
Generate and add new commands by running pyrig mkcmd <command-name>.
An automatic version command is included that shows the version of your project.
Run my-project version to see it in action.
Generate test skeletons with pyrig mktests.
This will generate test skeletons for all source modules
and update them automatically as your project evolves.
pyrig enables automatic sharing and registration of pytest fixtures.
Run pyrig mkfixture <fixture-name> to generate a new fixture that is
automatically registered and available across all your tests.
PyInstaller integration and extensible build system for generating executables,
distributable packages, and more.
Run pyrig subcls to create a custom builder for your specific build needs.
Run pyrig build to execute the build process and generate artifacts.
Run pyrig resources to create a resources directory for your project.
Override and customize any and all behaviour to suit your project's needs.
pyrig's classes are designed for inheritance and composition, allowing you to
create custom configurations, tools, builders, and more by subclassing and simply
overriding methods. pyrig will automatically discover and use your custom classes
without any additional configuration.
Run pyrig subcls to generate a subclass for any pyrig class.
Pyrig generates GitHub Actions workflows for CI/CD and automatically configures
and applies repository protection settings and branch protection rules to ensure
your repository is protected.
Run pyrig protect-repo to apply or update repository protection settings or
simply use the fully working CI/CD pipeline to apply them automatically.
Run pyrig <command> --help for more information about a specific command and
its usage.
uv run pyrig init # Full project initialization
uv run pyrig mkroot # Create/update all concrete config files
uv run pyrig mktests # Generate test skeletons
uv run pyrig mkinits # Create missing __init__.py files
uv run pyrig mkfixture # Generate a new pytest fixture
uv run pyrig subcls # Generate a subclass for overriding a config or tool
uv run pyrig build # Build artifacts (PyInstaller, etc.)
uv run pyrig protect-repo # Configure repository protection
uv run pyrig scratch # Execute the project's .scratch.py file
uv run pyrig rmpyc # Remove __pycache__ directories
uv run pyrig version # Show pyrig version
uv run my-project --help # Your project's CLI
uv run my-project version # Show your project's version| Full Documentation | The manually written documentation |
| CodeWiki | AI-generated documentation |
| Tutorials | YouTube tutorials for pyrig |