Sets up Python library projects with pyproject.toml, uv, ruff, pytest, pre-commit, GitHub Actions, and Makefiles. For creating new libraries, modernizing to pyproject.toml, or configuring linting, testing, CI.
npx claudepluginhub wdm0006/python-skills --plugin python-library-distributionThis skill uses the workspace's default tool permissions.
Create a new library with this structure:
Applies Acme Corporation brand guidelines including colors, fonts, layouts, and messaging to generated PowerPoint, Excel, and PDF documents.
Builds DCF models with sensitivity analysis, Monte Carlo simulations, and scenario planning for investment valuation and risk assessment.
Calculates profitability (ROE, margins), liquidity (current ratio), leverage, efficiency, and valuation (P/E, EV/EBITDA) ratios from financial statements in CSV, JSON, text, or Excel for investment analysis.
Create a new library with this structure:
my-library/
├── src/my_library/
│ ├── __init__.py
│ └── py.typed
├── tests/
├── pyproject.toml
├── Makefile
├── .pre-commit-config.yaml
└── .github/workflows/ci.yml
Use src/ layout to prevent accidental imports of development code.
For complete templates, see:
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "my-library"
version = "0.1.0"
description = "What it does"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
dependencies = []
[project.optional-dependencies]
dev = ["pytest>=7.0", "ruff>=0.1", "mypy>=1.0"]
[tool.setuptools.packages.find]
where = ["src"]
# Setup
pip install -e ".[dev]"
pre-commit install
# Daily workflow
ruff check src tests # Lint
ruff format src tests # Format
pytest # Test
mypy src # Type check
| Choice | Recommendation | Why |
|---|---|---|
| Layout | src/ | Catches packaging bugs early |
| Build backend | setuptools | Mature, broad compatibility |
| Linter | ruff | Fast, replaces flake8+isort+black |
| Python range | >=3.10 | Don't pin exact versions |
| Dependencies | Minimal | Move optional deps to extras |
Project Setup:
- [ ] src/ layout with py.typed marker
- [ ] pyproject.toml (not setup.py)
- [ ] Makefile with dev/test/lint/format
- [ ] .pre-commit-config.yaml
- [ ] .github/workflows/ci.yml
- [ ] README.md, LICENSE, CHANGELOG.md
- [ ] .gitignore
Create a new project structure:
python scripts/create_project.py my-library --author "Name"
This skill is based on the Guide to Developing High-Quality Python Libraries by Will McGinnis. See these posts for deeper coverage: