sphinxcontrib-autodoc-filterparams
Although it might usually be a symptom of poor architecture, sometimes you really want to exclude function parameters from your Sphinx documentation.
This extension does just that.
Usage
Add it to your conf.py extension list, typically immediately after the entry for
sphinx.ext.autodoc. If you use something like thenapoleonextension to re-format docstrings, then add it immediately after that.Declare a function called
sphinxcontrib_autodoc_filterparams.
Example
The following would hide all parameters whose names starts with an underscore:
extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib_autodoc_filterparams'
]
def sphinxcontrib_autodoc_filterparams(fun, param):
return not param.startswith('_')
The callback takes two arguments, the current function and parameter, and it should return a boolean indicating whether or not to keep the parameter.
A slightly more elaborate example looks at the function context as well as the name of the parameter:
exclude_params = {
'my_package.my_module.MyClass.my_method': {'**kwargs'}
}
def sphinxcontrib_autodoc_filterparams(fun, param):
exclude = exclude_params.get(fun.__module__ + '.' + fun.__qualname__)
return exclude is None or param not in exclude
Options
sphinxcontrib_autodoc_filterparams
The callback function, invoked for each function parameter. If this function
returns True then the parameter will be documented, otherwise it will
be excluded.
sphinxcontrib_autodoc_filterparams_stars
A boolean indicating whether or not asterisks should be prepended to parameter
names when invoking the callback (one star for variadic positional, two stars
for variadic keyword). Default is True.
Metadata
Release files for sphinxcontrib-autodoc-filterparams 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinxcontrib_autodoc_filterparams-0.0.1.tar.gz | 3.2 kB | Without provenance | Details for sphinxcontrib_autodoc_filterparams-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinxcontrib_autodoc_filterparams-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for sphinxcontrib_autodoc_filterparams-0.0.1-py3-none-any.whl |
Total release size: 8.0 kB
Release files / sphinxcontrib_autodoc_filterparams-0.0.1.tar.gz
| Download URL | sphinxcontrib_autodoc_filterparams-0.0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7dea59309629ce0aa2ea0ac52cb5dd6ba4c4f19545d8561287b94aca087158d3
|
|
BLAKE2b-256 checksum How to use checksums |
3b2c6b3ddc6010b9232e97cdeb0f2b545f51afc723bcb654ecb92e5d4815fe21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Release files / sphinxcontrib_autodoc_filterparams-0.0.1-py3-none-any.whl
| Download URL | sphinxcontrib_autodoc_filterparams-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
335dc7580cc7a86f44d3dadea93ee781d43a4d68ededfbae3842d90f1e92bd41
|
|
BLAKE2b-256 checksum How to use checksums |
06d40c8cb12222d9600dda44c064ff0cbc3b2fc5498e7bea54a5b4605c1a565b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for sphinxcontrib-autodoc-filterparams 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.