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.4.tar.gz (34.0 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.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thoth_doc-0.0.4.tar.gz
  • Upload date:
  • Size: 34.0 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.4.tar.gz
Algorithm Hash digest
SHA256 feeb2668ea26a107820e207fb915e95cdb6893e1df46ac721f3b5f8f1880328e
MD5 8c9618e75a286721dd55468456bd7b23
BLAKE2b-256 113b28f932747205c0bf9ef2beabb36f00330f905f7786ed67d09bc3f46a0b7f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thoth_doc-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 528e79bc53b5e5d7ae1a4f57511f9177511e5805020720a88cfcb6e0ad1ff6eb
MD5 f8e47d6ef15b4eac70a94ee905e47eb3
BLAKE2b-256 4d32b5ddd615b8d4053729d904ff139d6981fe15ff1dbb4bd5780f48a3a8c826

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