Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

= AsciiDocString
:toc: left
:sectnums:

A semantic parser, extractor, and translator for Python docstrings written in AsciiDoc.

== Introduction

`asciidocstring` is a Python library built on top of the pure-Python `asciidoctrine` parser. It is designed to clean raw docstrings (stripping common indentation) and compile them into a structured Abstract Semantic Graph (ASG).

This parsed semantic graph can be used by downstream libraries to:
1. Render high-fidelity reStructuredText for Sphinx (`sphinx-asciidoc`).
2. Query and run interactive doctests (`asciidoctest`).

== Installation

[source,bash]
----
pip install asciidocstring
----

== Usage

=== Parsing a Docstring

[source,python]
----
import asciidocstring

docstring = """
= Parse Coordinates

This function processes dynamic coordinate objects.

[source,python,test]
----
assert parse_coords(10, 20) == (10, 20)
----

x (int):: The horizontal component
y (int):: The vertical component
"""

doc = asciidocstring.parse(docstring)

# Convert to reStructuredText (reST) for Sphinx
rest_output = doc.to_rest()

# Extract code blocks for doctesting
tests = doc.extract_tests()
----

== License

This project is licensed under the Apache License, Version 2.0.

Download files

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

Source Distribution

asciidocstring-0.1.0a2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

asciidocstring-0.1.0a2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file asciidocstring-0.1.0a2.tar.gz.

File metadata

  • Download URL: asciidocstring-0.1.0a2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for asciidocstring-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 cd5782c25518985e2db859fa5d24238e504c957c752b768f50829d4b40cb66ee
MD5 5c631d8d3904e5b6f113dee71a1f50be
BLAKE2b-256 bf784bffe4a4de457d57b3d522a0d45b3338c0d0a8a1373085122ac394a463c3

See more details on using hashes here.

File details

Details for the file asciidocstring-0.1.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for asciidocstring-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 36cfb2ded35a877a255b19f4679c6fd6a8ae700367a615ff2539453e935cc0bf
MD5 f702c4a2a1494249905b094505339c27
BLAKE2b-256 581dd6e51eb1ec6abdfcef2e2d116bfb0b2b28c920ad6a8c8a8b632d9d64c855

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.0

2 files

This release

0.1.0a2 This release

2 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