From python-library-distribution
Creates Python library documentation with Google-style docstrings, Sphinx setup, API references, tutorials, and ReadTheDocs configuration. Use when writing docstrings or setting up documentation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/python-library-distribution:documentationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```python
def encode(latitude: float, longitude: float, *, precision: int = 12) -> str:
"""Encode geographic coordinates to a quadtree string.
Args:
latitude: The latitude in degrees (-90 to 90).
longitude: The longitude in degrees (-180 to 180).
precision: Number of characters in output. Defaults to 12.
Returns:
A string representing the encoded location.
Raises:
ValidationError: If coordinates are out of valid range.
Example:
>>> encode(37.7749, -122.4194)
'9q8yy9h7wr3z'
"""
# Install
pip install sphinx furo myst-parser sphinx-copybutton
# Initialize
sphinx-quickstart docs/
conf.py essentials:
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon', # Google docstrings
'myst_parser', # Markdown support
]
html_theme = 'furo'
[project.optional-dependencies]
docs = [
"sphinx>=7.0",
"furo>=2024.0",
"myst-parser>=2.0",
]
# Package Name
[](https://pypi.org/project/package/)
Short description of what it does.
## Installation
pip install package
## Quick Start
from package import function
result = function(args)
## Documentation
Full docs at [package.readthedocs.io](https://package.readthedocs.io/)
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
sphinx:
configuration: docs/conf.py
python:
install:
- method: pip
path: .
extra_requirements: [docs]
For detailed setup, see:
README:
- [ ] Clear project description
- [ ] Installation instructions
- [ ] Quick start example
- [ ] Link to full documentation
API Docs:
- [ ] All public functions documented
- [ ] Args, Returns, Raises sections
- [ ] Examples in docstrings
- [ ] Type hints included
This skill is based on the Documentation section of the Guide to Developing High-Quality Python Libraries by Will McGinnis. See these posts for deeper coverage:
npx claudepluginhub wdm0006/python-skills --plugin python-library-completeGuides MkDocs Material setup with Diataxis framework, mkdocstrings and Griffe for API reference pages, Google-style docstrings, nav structure, code example testing, and deployment to GitHub Pages or ReadTheDocs.
Sets up and maintains documentation for scientific Python packages using Sphinx, MkDocs, NumPy-style docstrings, Diataxis framework, accessibility standards, and Read the Docs hosting.
Generates PyPI-compliant README files in Markdown or reStructuredText for Python packages. Fixes rendering issues, converts formats, validates with twine, and configures pyproject.toml.