Skip to main content

Inline documentation of parameters, returns, and raises

Project description

sigdoc

pypi downloads versions license CI codecov

Inline documentation of parameters, returns, and raises.


Documenting function parameters and returns in docstrings is tedious - type hints need to be duplicated, the order is hard to maintain, and added/removed params and returns easily get out of sync.

sigdoc provides helpers to automatically extend docstrings at runtime by annotating a function's parameter and return type hints "inline". This inline notation greatly increases the locality of the code and documentation, reducing the maintenance burden.

As this relies on runtime generation, the full docstring will only be visible to runtime inspection. Luckily, this includes help(...) in python, ipython, and jupyter (including Shift+Tab). Static analysis tools (such as many IDEs) won't know how to decipher the full docstring, but often show the function's signature, which will still have all of the useful information included.

Installation

sigdoc can be installed from PyPI on python 3.9+ with pip install sigdoc.

Contributing

Everyone is welcome to contribute - feel free to open an issue or PR!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sigdoc-0.0.2.tar.gz (6.6 kB view hashes)

Uploaded source

Built Distribution

sigdoc-0.0.2-py3-none-any.whl (6.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page