Skip to main content

pyrig is python toolkit that rigs up your project by standardizing and automating project setup, configuration and maintanence

Project description

pyrig

bandit pip-audit

git github podman pyrig uv

mkdocs Documentation

prek ruff rumdl ty

pypi python License

pytest pytest-cov

CI CD


pyrig is python toolkit that rigs up your project by standardizing and automating project setup, configuration and maintanence


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

uv init
uv add pyrig
uv run pyrig init

See the Getting Started Guide for detailed setup instructions.

Features

Project Scaffolding & Idempotent Init

pyrig's init command scaffolds a complete, production-ready Python project (source layout, tests, CI/CD, docs, configs, working CLI) and is safe to re-run due to its idempotency. See the Getting Started Guide for details and full generated project structure for the full layout.

Config File System

pyrig generated Files are modeled as Python classes in pyrig. They validate, and merge automatically. Extend or override configurations by subclassing. You can create your onw Config File classes as well and pyrig will handle them for you, you just need to define behaviour. See the Config Architecture documentation for details.

Dynamic Multi-Package CLI Discovery

pyrig init also sets up a CLI for your project, that works out of the box and can be extended with custom commands very easily. Just define a function in <package>.rig.cli.subcommands and it will be available as a CLI command automatically. pyrig also supports multi-package CLI discovery via defining a function in <package>.rig.cli.shared_subcommands which will be available in all downstream packages in the dependency chain, just like the version command provided by pyrig. See the CLI docs for details.

Pytest Enforcement, Autouse Fixtures && Test Skeleton Generation

pyrig comes with pytest configured as the test runner, and includes autouse fixtures that enforce best practices, validate project invariants, and auto-generate missing test skeletons. To generate test skeletons for missing tests, just run uv run pyrig mktests and pyrig will create test skeletons for any missing tests based on the source code structure. See the Test Structure docs for more details. pyrig's autouse fixtures check some things like ensuring that all source files have corresponding test files, that all packages have __init__.py files, and that Config Files are correct. They also auto-upgrade your dependencies via uv lock --upgrade to the latest allowed version defined in your pyproject.toml. See the Autouse fixtures documentation for details on all the autouse fixtures provided by pyrig.

Multi-Project Inheritance Model

pyrig allows you to override and customize almost any and all behavior in a project via its .L inheritance system. Just define a class that inherits from the pyrig provided class, override the behaviour you want to change, and pyrig will use your implementation instead of the default one. This applies to all Config Files, CLI commands, tools, builders, and more. You can even define your own custom Config Files and pyrig will handle them for you as long as they inherit from ConfigFile. This is a very powerful feature and a bit hard to explain easily, so please check out the documentation for more details and examples. In our opinion, the best thing this enables is that you can define your very own personal pyrig package that defines your own standards and tools, and then just add it as a dependency to all your projects to have those standards and tools available everywhere automatically by just running uv add my-pyrig-package and uv run pyrig init in each project, which is pretty amazing. See the Tool Architecture docs and the Config Architecture docs for details and examples.

Tool Wrappers

pyrig provides type-safe Python wrappers for all tools that are used (uv, git, ruff, pytest, etc.) to standardize usage and expose clear, typed interfaces. Via pyrig's multi-package inheritance model, projects can adjust or replace tool implementations by subclassing and overriding the provided tool classes — this allows organization-wide customization or per-project overrides, making tool behavior highly flexible — see the Tools docs for details.

Builders

pyrig includes a builders system (for example, PyInstaller integration) to create distributables, standardize build processes, and integrate with packaging back-ends — see the Builders docs for details.

Resource Abstraction (Dev + PyInstaller)

Helpers provide reliable access to package resource files in development and when bundled with PyInstaller. See the Resources docs for resource handling details.

CI/CD & Repository Automation

pyrig generates GitHub workflows, branch protection configs, issue/PR templates and includes commands to help configure repository protections and release flows — see the Branch protection docs for repository automation details.

Logging & CLI Controls

Global CLI verbosity flags (-v, -vv, -q) provide flexible logging formatting and levels to improve developer ergonomics for commands and tools — see the CLI docs.

Packaging & Distribution Integration

pyrig integrates with packaging and build back-ends (console scripts, uv_build) to simplify publishing and distribution. See pyproject.toml and the Builders docs for packaging and build details.

CLI Commands

uv run pyrig init         # Complete project initialization
uv run pyrig mkroot       # Create/update all config files
uv run pyrig mktests      # Generate test skeletons
uv run pyrig mkinits      # Create __init__.py files
uv run pyrig build        # Build artifacts (PyInstaller, etc.)
uv run pyrig protect-repo # Configure repository protection
uv run my-project --help  # Your project's CLI

Documentation

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

pyrig-9.0.1.tar.gz (138.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrig-9.0.1-py3-none-any.whl (209.5 kB view details)

Uploaded Python 3

File details

Details for the file pyrig-9.0.1.tar.gz.

File metadata

  • Download URL: pyrig-9.0.1.tar.gz
  • Upload date:
  • Size: 138.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyrig-9.0.1.tar.gz
Algorithm Hash digest
SHA256 815762eb3bd4aeddc73854dd7f2c82520e59b7f82dba46f5ea6a979d36c0a63c
MD5 b563d006e3824487c503aeea1d7dc78e
BLAKE2b-256 a282de1f4f32ccc20db8013b051c1d1ba692ea919d6d3577778945a47120f542

See more details on using hashes here.

File details

Details for the file pyrig-9.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyrig-9.0.1-py3-none-any.whl
  • Upload date:
  • Size: 209.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyrig-9.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75df1b714c949cbf948820f298f486d1709143e6a3ee131de508235cedf16edc
MD5 7de686469bef1cfe01a1f5c00b1fe640
BLAKE2b-256 4cefb5bff9dfecdfd8c34e518f720bfd08643124868d2975d095c5f6d66c5384

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page