Automate Python package development the right way — inspired by R's usethis.
Project description
packright
Automate Python package development the right way — inspired by R's usethis.
Installation
pip install packright
Quickstart
# Create a new package with all conventions in place
packright scaffold my-analytics-lib
cd my-analytics-lib
uv sync
uv run pytest
This creates a complete package with src/ layout, errors.py, _messages.py, tests, docs, CI — all conventions in place, passing 22/22 checks.
Commands
Create
| Command | What it does |
|---|---|
packright scaffold <name> |
Create a complete package from scratch |
packright init |
Interactive project setup (prompts for name, author, license) |
packright use-module <name> |
Create a paired module + test file |
Configure
| Command | What it does |
|---|---|
packright use-pytest |
Add pytest config + test structure |
packright use-mkdocs |
Add mkdocs-material documentation |
packright use-pre-commit |
Add pre-commit hooks (ruff, mypy) |
packright use-ruff |
Add ruff linter/formatter config |
packright use-mypy |
Add mypy strict config + py.typed |
packright use-coverage |
Add coverage.py config |
packright use-rich |
Add _messages.py for structured output |
packright use-errors |
Add errors.py exception hierarchy |
Integrate
| Command | What it does |
|---|---|
packright use-github-actions |
Add CI, release, and docs workflows |
packright use-gitlab-ci |
Add GitLab CI pipeline |
packright use-git |
Init git + .gitignore + initial commit |
packright use-github |
Create GitHub repo via gh CLI |
packright use-docker |
Add Dockerfile + .dockerignore |
Manage
| Command | What it does |
|---|---|
packright use-license |
Add LICENSE file (MIT) |
packright use-readme |
Generate README with badges |
packright use-changelog |
Add CHANGELOG.md |
packright use-contributing |
CONTRIBUTING + CODE_OF_CONDUCT + issue templates |
packright use-dep <name> |
Add a dependency |
packright use-dev-dep <name> |
Add a dev dependency |
packright bump-version <part> |
Bump version (major/minor/patch) |
Inspect
| Command | What it does |
|---|---|
packright check |
Audit project against 22 conventions |
packright doctor |
Check development environment (uv, git, gh, ruff) |
packright browse-pypi |
Open PyPI page in browser |
packright browse-github |
Open GitHub repo in browser |
packright browse-docs |
Open docs site in browser |
Examples
# Start from scratch
packright scaffold my-lib
cd my-lib
# Or add to an existing project piece by piece
packright use-pytest
packright use-ruff
packright use-pre-commit
packright use-github-actions
# Check what's missing
packright check
# Add a new feature module
packright use-module auth
# Bump version and release
packright bump-version minor
git tag v0.2.0
git push --tags # CI publishes to PyPI
Philosophy
packright follows the python-package-development skill conventions — 5 principles from R's package ecosystem applied to Python:
- User communication is first-class —
rich, notprint() - Function names form a grammar —
verb_noun()patterns - Lifecycle deserves ceremony — formal deprecation process
- Documentation lives next to code — Google docstrings + mkdocs
- There is a whole game — scaffold first, refine later
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 packright-0.1.0.tar.gz.
File metadata
- Download URL: packright-0.1.0.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c1b043fbaf3fc135ffff7d7fdf01b818d54ae0981870770f371bdf66e5c19a1
|
|
| MD5 |
a9ad451716391d143587f049f9e5236b
|
|
| BLAKE2b-256 |
96dd7985bba87e014c1e1d1b40855345d8aa15d3993dae41dc8f06a4a1e3de21
|
File details
Details for the file packright-0.1.0-py3-none-any.whl.
File metadata
- Download URL: packright-0.1.0-py3-none-any.whl
- Upload date:
- Size: 44.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5a9aca9070582294cba6cd960b510be6e5a684ffefa67c7b4f86b4c79cc9cf4
|
|
| MD5 |
7a40eb951d08ff7ace4818fadd18b633
|
|
| BLAKE2b-256 |
cd0d12bc2f41fef6939595c952d8cef049828fcb49046a710d42c6d05e2dd774
|