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
File details
Details for the file readme-docstring-2019.3.9.tar.gz
.
File metadata
- Download URL: readme-docstring-2019.3.9.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57078aed5075efc82a9029460588ac2782249fe2c923c99e34443126ef64eaf7 |
|
MD5 | fedbf53396dfec1fdcda865fa61df128 |
|
BLAKE2b-256 | b7fa80390e04d074a19d203e377e4a2e1e0d6155ca98efbbb5443753d6d9c952 |
File details
Details for the file readme_docstring-2019.3.9-py2.py3-none-any.whl
.
File metadata
- Download URL: readme_docstring-2019.3.9-py2.py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0caa2548d4d4b44f709c2533e0971b5df68a6d8e150ad6ae028f1af70f020fdf |
|
MD5 | 34d8a9a3194964b2be0dda1bcb10f87a |
|
BLAKE2b-256 | e545d17bc1880abc92ec0cef23562d3c2c65d62c7fd19aa5777fd1fc562dc48f |