Skip to main content

Get Python docstrings from files

Project description

docstring-extractor

Get Python docstrings from files or Python source code.

Example usage:

>>> from docstring_extractor import get_docstrings
>>>
>>> with open("example.py") as file:
...     get_docstrings(file)
...

{
    'module': 'example',
    'content': [{
        'type': 'Function',
        'name': 'my_fuction',
        'line': 4,
        'docstring': 'Long description spanning multiple lines\n- First line\n- Second line\n- Third line\n\n:param name: description 1\n:param int priority: description 2\n:param str sender: description 3\n:raises ValueError: if name is invalid'
    }]
}

Contributing

This project uses Black.

Project details


Download files

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

Files for docstring-extractor, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size docstring_extractor-0.4.0-py3-none-any.whl (14.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size docstring-extractor-0.4.0.tar.gz (14.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page