Auto generate docstring from type-hints.
Project description
docstring_generator
Auto generate docstring from type-hints
How to use it
gendocs file.py
gendocs mydir/
Options
style
--style
- Docstring style [numpy, rest]. [default: numpy]
ignore-classes
--ignore-classes
- when used then no class will be modified
ignore-functions
--ignore-functions
- when used then no function will be modified this
- !important class methods are no functions in this context
Add additional information before running gendocs
- when adding
$<num>
into your docstring these will then be replaced with parameter at this index - Example:
from typing import List
def foo(val_a: int, val_b: List[int]):
"""
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
$1 Lorem ipsum dolor sit amet
$2 nonumy eirmod tempor invidun
"""
will become (here with numpy style)
from typing import List
def foo(val_a: int, val_b: List[int]):
"""
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
Parameters
----------
val_a : argument of type int
Lorem ipsum dolor sit amet
val_b : argument of type List(int)
nonumy eirmod tempor invidun
"""
Examples
- An example can be found under examples
Installing
- pip install docstring-generator
Versioning
- For the versions available, see the tags on this repository.
Authors
- Felix Eisenmenger
License
- This project is licensed under the MIT License - see the LICENSE.md file for details
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 docstring-generator-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61455b77d62bc69af117f5ea4cc480fabf269138b1f96cb1611a36d4e69aa0a5 |
|
MD5 | 9a942abdd79307cdde7768c1d6b91f17 |
|
BLAKE2b-256 | bb8f0f0f36071aa160e85c898d0847e5a619c8434d7146488b630fd8bb6e26a5 |
Close
Hashes for docstring_generator-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf39e392eb2c888a7912b0e073616afc5fb1ee624e70fa85c912121a3650f276 |
|
MD5 | b26d0dd8db8d52e1891e096e94b1a354 |
|
BLAKE2b-256 | b00840f185ffd99af45ca0d464aceeb7eb0a917c3250eeda5acde405cbfbb2d2 |