Skip to main content

expand and analyze RST (reStructureText) documents with auto*-directives

Project description

rstparse Package

rstparse - expand and analyze RST (reStructureText) documents with auto*-directives


This manual page documents rstparse, a Python module for parsing RST (reStructureText) documents.

Many documents of Python and its standard libraries, as well as a vast number of third party modules are written as RST (reStructureText) markup documents. RST documents are easier to handle since, similarly to other markup document formats such as Markdown, it is mostly a plain text file with several additional notations.

Since RST documents are plain text files, you can easily browse those documents using your favorite tools like pagers (e.g., more, less, and lv) and also you can search for topics that you are interested in using common tools such as grep.

However, a significant portion of RST files use auto directives (e.g., autosummary, automodule, autoclass, and autofunction), which ask the RST parser to include the contents from somewhere outside the RST document. For instance, if an RST file contains a line,

.. autosummary: good_func

the description of good_func is not contained in this file. autosummary means the description must be inserted here. It is an RST parser's responsibility to identify where the description of good_func is stored. rstparse module parses an RST file and expands all auto*-directives.


import rstparse

file = 'foo.rst'
rst = rstparse.Parser()
with open(file) as f:
for line in rst.lines:


pip3 install rstparser


The latest version of rstparser module is available at PyPI ( .



Hiroyuki Ohsaki <ohsaki[atmark]>

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rstparse, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size rstparse-1.0-py3-none-any.whl (16.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size rstparse-1.0.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page