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 <ohsaki[atmark]lsnl.jp>

Project details


Release history Release notifications | RSS feed

This version

1.0

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.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

rstparse-1.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rstparse-1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for rstparse-1.0.tar.gz
Algorithm Hash digest
SHA256 3c22641e5cddffeae3375b83ca1f3f864dfdffac54d66a84e6437b3ffeea2097
MD5 539331de5348106f597e3b27d07d2627
BLAKE2b-256 1546a369a55b74ee4ccd00cfb14ff43927d76b58d0700c07e576df8ff91d7e1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rstparse-1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for rstparse-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 991c54d7be03a3441b8f48ff1f883d46e91c6c0c5c4772dd11ad54899e144e01
MD5 34998ec4e9d17e4596499d4dc1252f7d
BLAKE2b-256 c3a36e5c1c90539b37bc1957c9730d9d024680dec022840210e9723ed0390be1

See more details on using hashes here.

Supported by

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