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

DESCRIPTION

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.

EXAMPLE

import rstparse

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

INSTALLATION

pip3 install rstparser

AVAILABILITY

The latest version of rstparser module is available at PyPI (https://pypi.org/project/rstparser/) .

SEE ALSO

AUTHOR

Hiroyuki Ohsaki <code[atmark]lsnl.jp>

Project details


Download files

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

Source Distribution

rstparse-1.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rstparse-1.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file rstparse-1.1.tar.gz.

File metadata

  • Download URL: rstparse-1.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rstparse-1.1.tar.gz
Algorithm Hash digest
SHA256 817d940c17cefcf308784efb3473d3d60313cda3af0a7162d3cac98de6e9689a
MD5 5fa8d79f9df62f7feaafa0fc3e1961b4
BLAKE2b-256 05b0cfcc53ad3e3d2fdd7029b12522d022af3516e2f732aa65f97b2254c8c7bd

See more details on using hashes here.

File details

Details for the file rstparse-1.1-py3-none-any.whl.

File metadata

  • Download URL: rstparse-1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rstparse-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 231d9a1491a4da2bff56a010b8731e26f14dbeaac338ab50e0b632ef63915b17
MD5 b5ebe50986c4931d7757fd6c29c530fd
BLAKE2b-256 24c4cb0233b84cd710baae54de203ab7a681975d22938e1ab4160e468aad784b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page