generate README from python docstrings
Project description
Install
[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 |
Examples
example with readme-generator
class Readme(readme_generator.Readme):
def classes(self):
return readme_docstring.Classes()
def functions(self):
return readme_docstring.Functions()
custom table
class Cli(readme_docstring.Table):
columns = ["usage", "`__doc__`"]
def __init__(self):
self.objects = list(filter(lambda m: hasattr(m, "click"), setupcfg.getmodules()))
def get_name(self, obj):
default = "python -m %s" % obj.__name__.replace(".__main__", "")
return "`%s`" % getattr(obj, "USAGE", default)
Related projects
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
Built Distribution
Close
Hashes for readme-docstring-2019.3.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0543478e85bfe651a879d03883f26e2f2d6832dff4b8de6c552a356dcb5389f5 |
|
MD5 | 2966fc5715264afee227502e7532db16 |
|
BLAKE2b-256 | 6f795c3642a758151e75eace96cea11561a9d4e9a9c683332cb3bcb7202545f3 |
Close
Hashes for readme_docstring-2019.3.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ded5e662cb04ff7d47941e375400b00b3ba41eab3f1ed6038a08397d182db38 |
|
MD5 | e55fc5825f00804675a8b73ce7889d85 |
|
BLAKE2b-256 | 14203edb55cac5154a8fc52385be8e301839bbd8524f4452a18e6d3754191fbc |