Auto generate docstring from type-hints.
Project description
docstring_generator
Auto generate docstring from type-hints for python functions and class methods.
How to use it
gendocs_new file.py
gendocs_new mydir/
Options
style
--style- Docstring style [numpy, google, rest]. [default: numpy]
Add additional information before running gendocs_new
- 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
"""
FAQ
what happens if I re-run the docstring creation?
- nothing if all stays the same, changed parameter descriptions will be ignored only changes of the function header will be used
Examples
- An example can be found under examples
Installing
- pip install docstring-generator
Dependency
- docstring-generator-ext
- this extension is the heart of this project and written with pybind11 (c++)
Versioning
- For the versions available, see the tags on this repository.
Authors
- Felix Eisenmenger
License
- MIT License (MIT)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docstring_generator-1.0.2.tar.gz.
File metadata
- Download URL: docstring_generator-1.0.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b20d0ff97bdda2e12251cca2591a8418d788d6d5bbbb42ad00ae5f9366176edc
|
|
| MD5 |
b54da80910c72f0fed13c23c824f9498
|
|
| BLAKE2b-256 |
5448d97eb472cd7627de1fd6d27afbd407a600ae30fe8392fffbdb18686570e5
|
Provenance
The following attestation bundles were made for docstring_generator-1.0.2.tar.gz:
Publisher:
python-publish.yml on FelixTheC/docstring_generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docstring_generator-1.0.2.tar.gz -
Subject digest:
b20d0ff97bdda2e12251cca2591a8418d788d6d5bbbb42ad00ae5f9366176edc - Sigstore transparency entry: 1535617016
- Sigstore integration time:
-
Permalink:
FelixTheC/docstring_generator@05c8fa0ed73a248b529afadf6aee6ec1e45087f1 -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/FelixTheC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@05c8fa0ed73a248b529afadf6aee6ec1e45087f1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file docstring_generator-1.0.2-py3-none-any.whl.
File metadata
- Download URL: docstring_generator-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d74a4656844bdcd23ebbbf9087e0a10d59316821963f37fed82a1573b7f82ab
|
|
| MD5 |
697d08ae0c8fc5260fae827192daab52
|
|
| BLAKE2b-256 |
4dbc19d52ab9b0295d928468ccc38fcbafe8033a49be0e7251a210ac644c8ea3
|
Provenance
The following attestation bundles were made for docstring_generator-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on FelixTheC/docstring_generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docstring_generator-1.0.2-py3-none-any.whl -
Subject digest:
1d74a4656844bdcd23ebbbf9087e0a10d59316821963f37fed82a1573b7f82ab - Sigstore transparency entry: 1535617105
- Sigstore integration time:
-
Permalink:
FelixTheC/docstring_generator@05c8fa0ed73a248b529afadf6aee6ec1e45087f1 -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/FelixTheC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@05c8fa0ed73a248b529afadf6aee6ec1e45087f1 -
Trigger Event:
release
-
Statement type: