generate README from python docstrings
Project description
Installation
$ [sudo] pip install readme-docstring
Classes
class | __doc__ |
---|---|
readme_docstring.Classes |
classes table class. attrs: classes |
readme_docstring.Functions |
functions table class. attrs: functions |
readme_docstring.Table |
abstract table class. attrs: headers , objects |
Functions
function | __doc__ |
---|---|
readme_docstring.getclasses() |
return a list of classes defined in __all__ |
readme_docstring.getdoc(obj) |
return first line of an object docstring |
readme_docstring.getfunctions() |
return a list of functions defined in __all__ |
readme_docstring.getmembers() |
return all the members defined in __all__ in a list of (name, value) pairs |
readme_docstring.getmodules() |
return a list of modules |
readme_docstring.getspec(routine) |
return a string with Python routine specification |
Executable modules
usage | __doc__ |
---|---|
python -m readme_docstring.classes |
generate classes table |
python -m readme_docstring.functions |
generate functions table |
Examples
example with readme-generator
class Readme(readme_generator.Readme):
order = [..., "classes", "functions", ...]
def classes(self):
classes = self.getclasses()
return readme_docstring.Classes(classes)
def functions(self):
functions = self.getfunctions()
return readme_docstring.Functions(functions)
custom table
class ExecutableModules(readme_docstring.Table):
columns = ["usage", "`__doc__`"]
def __init__(self,modules):
self.objects = modules
def getleftcell(self, obj):
default = "python -m %s" % obj.__name__.replace(".__main__", "")
return "`%s`" % getattr(obj, "USAGE", default)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for readme-docstring-2019.4.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45a32ceef56ec20dde92a635a0144302ce45880d80951727453c9230d13d84c6 |
|
MD5 | 5ec17ecd1afe4815801a9f1025692d11 |
|
BLAKE2b-256 | ee8b1879427c6079ce026c45acbe94553a37a17c6668182b0249168c58327a03 |