What is pyrig?
pyrig generates and maintains a complete, production-ready Python project from a single command. It creates all the files you need — source structure, tests, CI/CD, documentation, configs — and keeps them in sync as your project evolves. Rerun it anytime: pyrig is idempotent.Quick Start
Get up and running with pyrig in under 2 minutes
Architecture
Understand the core systems that power pyrig
Key Features
Idempotent Scaffolding
Run
pyrig init to generate a complete project. Run it again anytime to sync — pyrig never overwrites your customizations.Config File System
Every generated file is backed by a Python class that validates and merges automatically. Override any config by subclassing.
Automatic CLI
Your project gets a working CLI immediately. Add commands by defining functions — they’re discovered automatically.
Testing Infrastructure
pytest with autouse fixtures that enforce best practices.
pyrig mktests generates test skeletons mirroring your source.Multi-Package Inheritance
Create a personal pyrig package with your own standards, add it as a dependency, and have everything apply automatically.
Tool Wrappers
Type-safe wrappers around uv, git, ruff, pytest, and more. Customizable via subclassing for org-wide overrides.
What You Get
When you runpyrig init, you get a complete project structure:
Core Philosophy
pyrig is built around three principles:1. Declarative Over Imperative
You declare what should exist, pyrig makes it happen. Configuration files are defined as Python classes that specify expected structure:pyrig mkroot and the file is created or updated, preserving any user customizations.
2. Idempotent by Default
Every operation is safe to run multiple times. pyrig never overwrites your changes — it validates, merges, and preserves:- Missing keys are added
- Extra keys you added are preserved
- Final structure matches expected configuration
- Opt-out by emptying the file
3. Extensible Through Inheritance
Almost everything in pyrig can be overridden by subclassing. The.I pattern (Instance) and .L pattern (Leaf) automatically discover your implementations:
Use Cases
New Projects
Bootstrap a production-ready Python project with full CI/CD, testing, and documentation in seconds.
Existing Projects
Standardize your existing project’s structure, tooling, and workflows incrementally.
Organization Standards
Create a company-wide pyrig extension with your organization’s standards and share across all projects.
Multi-Project Tooling
Build CLI tools that work consistently across multiple pyrig-based projects.
Requirements
- Python: 3.12+
- Package Manager: uv (recommended) or pip
- Version Control: git
pyrig uses modern Python features including PEP 695 type parameters and PEP 692 Unpack. Python 3.12+ is required.
Project Status
Version: 10.2.3
Status: Production/Stable
License: MIT
Next Steps
Install pyrig
Follow the quickstart guide to get pyrig running in your project
Learn the Architecture
Understand how pyrig’s config system, CLI, and inheritance work