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 |
CLI
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):
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
classifiers-generator
- python classifiers generatorcommands-generator
- shell commands generatorlaunchd-generator
- launchd.plist generatorreadme-badges
-README.md
badgesreadme-docstring
- generate README.md from python docstringsreadme-generator
-README.md
generatorsetupcfg-generator
-setup.cfg
generatortravis-generator
-.travis.yml
generator
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.22.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf7ad31ebdac8198ba65784bf59cbc47e6c6f6c7f9d1d073245d814f107463d1 |
|
MD5 | 522fdd4ac5e1c90b475e91d440aeb26c |
|
BLAKE2b-256 | 0dafd798c80c2457c8b60679188c41a8e5969743d9d19a3922ea291e8dffec09 |
Close
Hashes for readme_docstring-2019.3.22-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73c846f4e28d7401db7e8df7d30b3b2fec971ae6a229de69a981ce82b2c00827 |
|
MD5 | 2efa47bb12c548a0de99c59889562c01 |
|
BLAKE2b-256 | f41c9a30509bd49c202eb1bba545655e5491f62b11fdd9afe94e7bb091fb1bd1 |