Sphinx is the Python documentation tool that generates documentation from docstrings and supports reStructuredText.
Written in Python, Sphinx converts reStructuredText source files into HTML and other output formats, including PDF, EPUB, Texinfo, and man pages. Its autodoc extension can import Python modules and incorporate documentation written in their docstrings, helping projects keep API references close to the code that implements them.
Sphinx’s first public release appeared on March 21, 2008. It was developed for Python’s documentation and became widely adopted by projects such as Django, SciPy, SQLAlchemy, SageMath, and Blender. Its extension system supports syntax highlighting, mathematical notation, cross-references, custom directives, and alternative input formats such as Markdown through MyST Parser.
A common mix-up is treating Sphinx as merely a docstring extractor. It is a full documentation generator: docstrings are one input, while reStructuredText pages, navigation, themes, indexes, and cross-references form the broader documentation project. pydoc is a simpler standard-library tool, while MkDocs is primarily Markdown-oriented.