Skip to main content

Get Python docstrings from files

Project description


Get Python docstrings from files or Python source code.

Example usage:

>>> from docstring_extractor import get_docstrings
>>> with open("") 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'


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.

Source Distribution

docstring-extractor-0.3.0.tar.gz (14.7 kB view hashes)

Uploaded source

Built Distribution

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