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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57078aed5075efc82a9029460588ac2782249fe2c923c99e34443126ef64eaf7 |
|
MD5 | fedbf53396dfec1fdcda865fa61df128 |
|
BLAKE2b-256 | b7fa80390e04d074a19d203e377e4a2e1e0d6155ca98efbbb5443753d6d9c952 |
Close
Hashes for readme_docstring-2019.3.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0caa2548d4d4b44f709c2533e0971b5df68a6d8e150ad6ae028f1af70f020fdf |
|
MD5 | 34d8a9a3194964b2be0dda1bcb10f87a |
|
BLAKE2b-256 | e545d17bc1880abc92ec0cef23562d3c2c65d62c7fd19aa5777fd1fc562dc48f |