Skip to content

Mariownyou/thoth-doc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Dependency-free, lightweight docstring parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages