Skip to main content

docstring-utils

build version license discord

Simple parser for Numpy, Sphinx, and Google-style docstrings

📥 Installation

pip install -U docstring-utils

Requirements: Python 3.7+

🧑‍💻 Usage

Parse docstring

from docstring_utils import parse_docstring

def example(arg1: str, arg2: int) -> int:
    """Example of a Google-style docstring.

    Args:
        arg1 (str): Description of `arg1`.
        arg2 (int): Description of `arg2`.

    Returns:
        int: Description of `return` value.
    """
    return 0

result = parse_docstring(example, filter_args=True)

print(result.description)  # "Example of a Google-style docstring."

args = result.args.values()
print(args[0].name)  # "arg1"
print(args[0].description)  # "Description of `arg1`."
print(args[0].type)  # "str"

print(result.return_value.type)  # "int"
print(result.return_value.description)  # "Description of `return` value."

🧰 Development

Running tests

  1. Install tox with the command pip install -U tox

  2. Run tests with the command tox

Linting

Run the following command to lint with flake8

python setup.py lint

(Note: The exact command may vary depending on your Python version and environment)

Metadata

Release files for docstring-utils 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docstring-utils 1.0.0
File Size Uploaded Provenance
docstring-utils-1.0.0.tar.gz 6.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for docstring-utils 1.0.0
File Interpreter ABI Platform
docstring_utils-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 kB

Release files / docstring-utils-1.0.0.tar.gz

Download URL docstring-utils-1.0.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ecbafb71ed041c63a3ba906d600fc564b90bc25b580b63a6c0d9f85d6075eda5
BLAKE2b-256 checksum
How to use checksums
734b58b1ca65a59840aea1b068660798f5eb370f6c6f3f7da465940e74b49aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release files / docstring_utils-1.0.0-py3-none-any.whl

Download URL docstring_utils-1.0.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3eb2eaa6a7824e4b32204e0e1dbce057fe91e101a53f128836bcfbc2a7020460
BLAKE2b-256 checksum
How to use checksums
676f31a220cb9097961292f4868a37670c32c450b7019ef9f7cb65fdabd3c958
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Security for docstring-utils 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page