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.

Source Distribution

docstring-extractor-0.2.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

docstring_extractor-0.2.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file docstring-extractor-0.2.0.tar.gz.

File metadata

  • Download URL: docstring-extractor-0.2.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.5 Linux/5.4.0-52-generic

File hashes

Hashes for docstring-extractor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 80d5abe92b33a1ff841ac678bc6f40035408879a6cfcc0c7e03ce497d7b604b9
MD5 c85f0b42b93fd04b6d2ac7af3e68da80
BLAKE2b-256 4e1f562ae9cea16de97e98bb1daa6bad55c9625cc023f63f21ab123bdb0b6558

See more details on using hashes here.

File details

Details for the file docstring_extractor-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docstring_extractor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dde16b987cb627c17d051fd610597c9ec27ff3fd8aac9dca8d2e16a876526040
MD5 822f5dec8969c5244e721bc38d34bd0f
BLAKE2b-256 ba610f5def0adea449c62edd3da2705071d72fa5ea398c2de68205ea124d16ef

See more details on using hashes here.

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