--- id: sybil version: "10.1.0" license: MIT license_treatment: permissive maintenance: active --- # sybil — Automated testing for the examples in your code and documentation. License: permissive · Maintenance: active · Downloads: 572.3K/mo ## What it is and what it does Sybil is a testing library that extracts code examples from your documentation and source files, then runs them as part of your test suite. Instead of manually keeping examples in sync with your code, Sybil parses them directly from their source (reStructuredText, Markdown, or other formats) and validates that they execute correctly. This catches documentation rot early—when an API changes, the tests fail immediately if examples become outdated. The library integrates with standard Python test runners, so examples run alongside your unit tests with no special setup. It has no external runtime dependencies, making it lightweight to add to any project. It's designed for developers who want their documentation to be a reliable, executable specification rather than prose that drifts out of sync with the code. Use it for: - Validate code snippets in API documentation to ensure they remain correct as the codebase evolves - Test example scripts embedded in README or tutorial files as part of CI/CD - Verify that code samples in docstrings and reStructuredText files actually run without errors - Catch breaking changes early by running documented examples in your test suite - Maintain a single source of truth for examples instead of duplicating them in tests and docs ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Sybil parses and executes code examples embedded in your source code and documentation as part of your normal test suite, validating that documented examples actually work. Yes. Sybil fills a real gap: keeping documentation examples in sync with code. It has no dependencies, low install friction, active maintenance, a permissive license, and solves a concrete problem that affects most projects with substantial documentation. The only reason not to install is if you have no documented examples to validate. ## Install pip install sybil uv add sybil poetry add sybil ## Installing sybil Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of 62 days ago with recent commits. Requires Python 3.11 or later. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions. Quickstart: pip install sybil from sybil import Sybil from sybil.parsers.rest import CodeBlockParser examples = Sybil([CodeBlockParser()], pattern='*.rst') Requires Python 3.11 or later. Verify before relying: - Whether Sybil supports all major test runners (pytest, unittest, nose) or only a subset - Whether it can extract examples from formats beyond reStructuredText and Markdown - Performance characteristics when running large numbers of examples ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 572.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags documentation example testing, code snippet validation, doctest alternative, example verification in docs, automated example testing, parse and run code examples, documentation correctness, documentation-testing, example-validation [View on SkillFed](https://skillfed.io/packages/sybil) · [View on PyPI](https://pypi.org/project/sybil/)