Tools for README.md Creation and Maintenance
Episode Deep Dive
Guest Introduction and Background
Ned Batchelder is a longtime member of the Python community, best known for creating and maintaining coverage.py, a widely used test coverage tool. Beyond his open-source work, Ned focuses on open source logistics at edX, where he ensures collaboration between community contributors and internal developers. He’s also created a variety of specialized tools that help streamline documentation, changelog generation, and project automation for Python projects. His wealth of experience offers a unique perspective on balancing automation and clarity in open-source development.
What to Know If You’re New to Python
- Be comfortable creating and editing markdown files—this conversation references many tools that operate on
.md
documentation. - Recognize that changelogs and readmes are essential for communicating project changes and usage information.
- Understand that tooling (like coverage tools, readme generators, etc.) is meant to simplify development and help users adopt your code.
- Be aware that community engagement, like crediting contributors or linking to external docs, is a big part of Python open-source projects.
Key Points and Takeaways
- Key Point #1: Why a Great README Matters
A clear and well-structured README is often the first contact users have with your project. It should explain what your project does, who it’s for, and how to get started quickly. Ned emphasizes how README files can immediately convey the quality and usability of a project. Properly crafted readmes reduce repetitive support questions and give your users confidence.
- Tools and Links:
- readme.so — Quick start for README scaffolding
- Hatch Fancy PyPI README — Advanced templating for your PyPI readme
- Tools and Links:
- Key Point #2: Automating README Creation and Maintenance
Generators like readme.so or Hatch Fancy PyPI README help you assemble sections dynamically instead of tediously managing multiple files. These tools can draw information from your
pyproject.toml
or from other sources to prevent duplication. Whether you want a drag-and-drop editor or a command-line approach, automation reduces human error and keeps docs current.- Tools and Links:
- Hatch Fancy PyPI README
- Shields.io — For creating live status badges
- Tools and Links:
- Key Point #3: Importance of Badges
Badges help communicate quick facts, such as build status, supported Python versions, or code coverage. They are embedded images (often from shields.io) that can dynamically update to reflect the latest project state. While badges can clutter a README if overused, they also lend credibility and immediate insight when used thoughtfully.
- Tools and Links:
- Shields.io — Customizable badges for GitHub
- All Contributors — Automated contributor acknowledgment
- Tools and Links:
- Key Point #4: Managing Changelogs Properly
An accurate changelog keeps users aware of what’s new, deprecated, or fixed. Automation can help (e.g., aggregating PRs), but Ned highlights the value of hand-editing or curating entries to ensure readability. The conversation referenced how critical it is to unify your source of truth for changes, whether that’s a single file or a dedicated directory of fragments.
- Tools and Links:
- Keep a Changelog — Guidelines for human-centric changelogs
- Town Crier — Fragment-based changelog generator
- Scriv — Ned’s own tool for changelog fragments
- Blurb — Used by CPython
- Tools and Links:
- Key Point #5: Handling Multiple Docs and Automation
Project docs are more than just one file. People may want separate files for release notes, contributing guidelines, and even FAQs. Tools like Will McGugan’s
factory
(FAQ generator) or Ned’s Dinghy can help fetch or compile different pieces of information scattered across issues or the codebase. The outcome is less duplication and more centralized, up-to-date info.- Tools and Links:
- factory (FAQ Generator) — Automate repetitive Q&A
- Dinghy — GitHub activity digests
- Tools and Links:
- Key Point #6: Ensuring Code Examples Remain Correct
Over time, code samples in documentation can drift from what your codebase actually does. Tools like mktestdocs can parse
.md
files to verify Python code blocks, ensuring consistency. This lowers the risk of user frustration by removing stale or broken examples.- Tools and Links:
- mkdocs-testdocs (mktestdocs) — Test code within Markdown
- Tools and Links:
- Key Point #7: Cog for In-File Automated Updates
Ned created Cog, which allows you to insert Python snippets inside text files that are then executed to produce output in the file. This helps ensure your README or doc references remain automatically synchronized with real code or dynamically fetched data. It’s especially useful to keep docstring snippets or example schemas in sync with the source code.
- Tools and Links:
- Key Point #8: Coverage.py’s Evolution and Release Process
Ned shared insights on coverage.py, which measures test coverage in Python. The upcoming 7.0 release simplifies config settings and adds features like rendering text reports in Markdown. Maintaining coverage.py highlights the need to balance new features with preserving stability for millions of users.
- Tools and Links:
- Key Point #9: Balancing Automation with Manual Curation
While many tools can generate or aggregate docs, Ned emphasized the continuing need for a human touch. Whether you’re writing README introductions, detailing a tricky change, or verifying user impact, manual edits will often produce higher-quality explanations that connect with readers.
- Tools and Links:
- Scriv — Combined manual and automated approach
- Release Drafter — Automated GitHub release note drafting
- Tools and Links:
- Key Point #10: Customizing Documentation to Your Audience
Determining whether your audience is brand-new to your topic or already well-versed makes a difference in how you structure your docs. Some maintainers prefer short readmes with links to separate docs; others embed all details in the readme. The vital lesson is clarity—guide the user to the right info at the right level of depth.
- Tools and Links:
- GitHub Pages — Option to host extended docs
- Sphinx — Popular doc generator for Python projects
- Tools and Links:
Interesting Quotes and Stories
- Ned Batchelder on writing docs: “You have to decide who you’re writing for, and that can be the hardest part.”
- On value of good changelogs: “I’ve found that trying to explain the feature sometimes makes me change the feature.”
Key Definitions and Terms
- Changelog: A record of all notable changes made to a project.
- Badge: A small, embedded image that communicates status or metrics, often dynamically updated.
- Markdown: A lightweight markup language for creating formatted text using a plain-text editor.
- Fragment-based Changelog: A technique where each merged PR or fix creates a small file fragment that later compiles into one changelog.
Learning Resources
Below are selected courses from Talk Python Training that can help you enhance your Python skills further.
- Python for Absolute Beginners: A perfect place to gain core Python coding skills.
- Getting started with pytest: Learn to write tests, which dovetails well with coverage measurement.
- Static Sites with Sphinx and Markdown: Create powerful documentation sites using Sphinx alongside Markdown.
Overall Takeaway
Sustaining a thriving open-source project means treating documentation—particularly the README and changelog—as first-class citizens. Thoughtful tools can automate repetitive chores, but they’re most successful when maintainers add clarity and context by hand. Above all, prioritize your users’ understanding and keep your project’s story accessible, whether that’s through structured readmes, curated changelogs, or dynamic badges.
Links from the show
Ned's website: nedbatchelder.com
Readme as a Service: readme.so
hatch-fancy-pypi-readme: github.com
Shields.io badges: shields.io
All Contributors: allcontributors.org
Keep a changelog: keepachangelog.com
Scriv: Changelog management tool: github.com
changelog_manager: github.com
executablebooks' github activity: github.com
dinghy: A GitHub activity digest tool: github.com
cpython's blurb: github.com
release drafter: github.com
Towncrier: github.com
mktestdocs testing code samples in readmes: github.com
shed: github.com
blacken-docs: github.com
Cog: github.com
Awesome tools for readme: github.com
coverage.py: coverage.readthedocs.io
Tailwind CSS "Landing page": tailwindcss.com
Poetry "Landing page": python-poetry.org
Textual: textualize.io
Rich: github.com
Join Mastodon Page: joinmastodon.org
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm
--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy