Skip to main content

Dependency-free, lightweight docstring parser

Project description

Thoth doc: Dependency-free, lightweight docstring parser

Thoth image

Installation

pip install thoth-doc

Usage

# code.py

def foo(bar: int, baz: str = "qux") -> None:
    """This is a docstring"""
    pass


class Foo:
    """This is a class docstring"""

    def bar(self, bar: int, baz: str = "qux") -> None:
        """This is a method docstring"""
        pass
from thoth_doc import get_docstring

docstring = get_docstring("code.py", "foo")  # find docstring of foo in code.py
print(docstring)  # "This is a docstring"

docstring = get_docstring("code.py", "Foo")  # find docstring of Foo class in code.py
docstring = get_docstring("code.py", "Foo.bar")  # find docstring of Foo.bar method in code.py

License

MIT License

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

thoth_doc-0.0.8.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

thoth_doc-0.0.8-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file thoth_doc-0.0.8.tar.gz.

File metadata

  • Download URL: thoth_doc-0.0.8.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for thoth_doc-0.0.8.tar.gz
Algorithm Hash digest
SHA256 81a3e21491ab2f5c5969a70990d0b174dcfccc94dc70af0d0af4ab5ec3a560e8
MD5 4a6772e2528bb00452d0bcc09445882c
BLAKE2b-256 231c1d0a5770c6ff50e992ec8dcf8e0f09fde8f8cf519992373603e1b0c76c29

See more details on using hashes here.

File details

Details for the file thoth_doc-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: thoth_doc-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for thoth_doc-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3b85410680258d91de8d45b403de9bd874b2afa8e8c27b8ba0fb87bd9b4406f8
MD5 3b8dbee6719f8d5353cb94e1e039e800
BLAKE2b-256 ce8068460d943e11432446e831cb68e893893795e012322a3ba945769bc2ff94

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