Skip to main content

Parse, test, and assert RST code-blocks

Project description

build python3.8 pypi codecov.io mit black

Parse and test README.rst Python code-blocks

Installation

$ pip install readmetester

Usage

readmetester [-h] [--version] [README.rst]

If a README.rst file is present in the current working directory it will be used if no arguments are provided

$ readmetester README.rst

Documenting

Python code begins with ">>> "

Continuation lines begin with "... "

Expected output can be quoted or unquoted

.. code-block:: python

    >>> print("Hello, world!")
    'Hello, world!'
.. code-block:: python

    >>> n = [
    ...     "zero",
    ...     "one",
    ...     "two",
    ... ]
    >>> for c, i in enumerate(n):
    ...     print(c, i)
    0 zero
    1 one
    2 two

Styles can be configured in a pyproject.toml file

[tool.readmetester]
style = "monokai"

Using readmetester API

>>> import readmetester
>>> readmetester.main()
"recursive exec not implemented"

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

readmetester-2.3.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

readmetester-2.3.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file readmetester-2.3.0.tar.gz.

File metadata

  • Download URL: readmetester-2.3.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.11+ Linux/5.16.11-200.fc35.x86_64

File hashes

Hashes for readmetester-2.3.0.tar.gz
Algorithm Hash digest
SHA256 2c310b29f4d099e71fc7b43c1885bfb5ff357941c18d0dcf5832a33924545887
MD5 28ed937f889936dee54a13eaf641e1e7
BLAKE2b-256 7aa5fb3ed43cc6899c2d61cdd5458f5d84ad6f61c24ad616ee813197e5ad17f6

See more details on using hashes here.

File details

Details for the file readmetester-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: readmetester-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.11+ Linux/5.16.11-200.fc35.x86_64

File hashes

Hashes for readmetester-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eea55f19ae4ded34c0250f69eae9f569d284f5cb950922dbf3e0dc25b46ee041
MD5 46f1ec0d9bd0e9eb2f4aa6a018c6c1ab
BLAKE2b-256 f6dce9dc9209a64184bb8a5a4e4120f878f5302a9968b5d4bda87284f5acae8b

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