Skip to main content

nanorst

nanorst converts a deliberately small subset of reStructuredText (rST) into readable plain text. A state hook can be used to convert inline formatting to other forms, such as terminal escapes or HTML.

from nanorst import rst_to_text, rst_to_terminal

assert rst_to_text("This is **important**.") == "This is important."
print(rst_to_terminal("This is **important**."))

Supported constructs include emphasis, strong emphasis, inline literals, references supplied by the caller, simple directives, and indented literal blocks. This module is intentionally a loose converter, not a standards-complete reStructuredText implementation.

Development

Create a virtual environment, then install the project and its test dependencies:

python -m pip install -e '.[test]'
pytest

Build both distribution formats and validate their metadata with:

python -m pip install '.[build]'
python -m build
twine check dist/*

Releases are published by the release.yml GitHub Actions workflow when a version tag such as v0.1.0 is pushed. Configure a PyPI Trusted Publisher for the enkore/nanorst repository, workflow release.yml, and environment pypi.

Users

borgbackup has been using nanorst since borg 1.1.0 as a lightweight rST terminal formatter for --help and borg help TOPIC. The same rST sources are also rendered using sphinx-doc for the manual.

License

BSD-3-Clause. See LICENSE.

Metadata

Release files for nanorst 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nanorst 1.0.1
File Size Uploaded
nanorst-1.0.1.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nanorst 1.0.1
File Interpreter ABI Platform
nanorst-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / nanorst-1.0.1.tar.gz

Download URL nanorst-1.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f4e8d36cadf59d4d953cb40a9e588e0314112c5520bc9fe3a50ba1c0adfbf2a1
BLAKE2b-256 checksum
How to use checksums
e0270b50200fab6086c962f2de509467af1b0b444c9fb69a23ebdcd6025a41f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release files / nanorst-1.0.1-py3-none-any.whl

Download URL nanorst-1.0.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5039a5975d0f443e451b8e75bec7856a76869c4ac640480ee929233dd00edb0
BLAKE2b-256 checksum
How to use checksums
d6d15a6bc2a6d4b402fd2a31ef85151f4b3582dd39211262e2d813dc93aa980c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page