hatch-fancy-pypi-readme
Fancy PyPI READMEs with Hatch
What it is and what it does
hatch-fancy-pypi-readme is a Hatch metadata plugin that lets you build your PyPI project description dynamically from reusable fragments. Instead of maintaining a single static readme or long_description, you define an ordered list of fragments in your pyproject.toml—each can be plain text, a whole file, or a slice of a file extracted using cut-off points or regex patterns. After assembly, you can run regex-based substitutions across the entire readme to fix relative links, linkify issue numbers, or make other global transformations.
It solves the common problem of wanting your PyPI readme to differ from your GitHub readme (e.g., without badges, with only the latest changelog section, or with absolute links). You configure it once in pyproject.toml and the plugin generates the readme at build time, eliminating the need for manual synchronization or complex setup.py logic.
Use it for:
- Assemble a PyPI readme from your main README minus badges, plus your LICENSE file and the latest release notes from CHANGELOG.
- Extract and display only the most recent version's changes from a changelog file using regex pattern matching.
- Automatically convert relative GitHub links to absolute PyPI-safe URLs via regex substitution across the final readme.
- Maintain separate documentation for GitHub (with badges and development notes) and PyPI (user-focused) without duplication.
- Build a readme that includes snippets from multiple source files, each trimmed to specific sections using start/end markers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Hatch plugin that generates dynamic PyPI project descriptions by concatenating text fragments, files, and file excerpts with regex-based filtering and substitution.
Yes. This is a stable, actively maintained plugin with low install friction and no security issues. Install it if you use Hatch and want to compose your PyPI readme from multiple sources or apply transformations without manual editing. Skip it only if you're satisfied with a static readme file or not using Hatch.
Install
hatch-fancy-pypi-readme on PyPI
pip
pip install hatch-fancy-pypi-readmeuv
uv add hatch-fancy-pypi-readmepoetry
poetry add hatch-fancy-pypi-readmeInstalling hatch-fancy-pypi-readme
Before you install
Low friction install with only two runtime dependencies (hatchling and tomli). Active maintenance with a recent release in 2025 and steady commit activity; no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for any project type.
Quickstart
# In pyproject.toml:
[build-system]
requires = ["hatchling", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[project]
dynamic = ["readme"]
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = "# My Project"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"
Requires Hatch as your build backend; only works with pyproject.toml-based projects.
Verify before relying
- Whether regex substitutions support all standard Python re module flags and features beyond DOTALL.
- Performance characteristics when assembling very large readmes from many fragments or large files.
- Whether file paths are resolved relative to the project root or the pyproject.toml location.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — hatchling, tomli |
| Maintenance | actively maintained — 470 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,632,891/month — #1,711 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hatch_fancy_pypi_readme-25.1.0-py3-none-any.whl
Keywords: documentation, hatch, pypi, readme
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
hatch-requirements-txtA Hatchling plugin that reads project…
permissive · top 5,000 on PyPI
hatch_build_scriptsA Hatch build plugin that runs arbitrary shell…
permissive · top 15,000 on PyPI
hatch-nodejs-versionProvides Hatch plugins to read and write Python…
permissive · top 15,000 on PyPI
hatch-regex-commitA Hatch plugin that automatically creates Git…
permissive · top 15,000 on PyPI
hatch-polylith-bricksA Hatch build hook that integrates Polylith…
permissive · top 15,000 on PyPI
hatch-vcsA Hatch plugin that automatically determines…
permissive · top 1,000 on PyPI
hatch-cythonA Hatch build hook that integrates Cython…
permissive · top 15,000 on PyPI
hatchling-autoextras-hookA Hatchling metadata hook that automatically…
permissive · top 5,000 on PyPI
towncrierTowncrier generates changelogs from individual…
permissive · top 5,000 on PyPI