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.4.0.tar.gz
(14.7 kB
view details)
Built Distribution
File details
Details for the file docstring-extractor-0.4.0.tar.gz
.
File metadata
- Download URL: docstring-extractor-0.4.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.3 CPython/3.8.5 Linux/5.4.0-65-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f20185ffccdbc8f1f3ebb23220ee7e39b30872f10ec5b18e8fac67064e538a17 |
|
MD5 | d8486b1284f06726a2ed44cced0420a2 |
|
BLAKE2b-256 | 522452e289dccdab85451bd9ab5975b149a3d17987d7558dfc5cc3c09264be20 |
File details
Details for the file docstring_extractor-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: docstring_extractor-0.4.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.3 CPython/3.8.5 Linux/5.4.0-65-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a9eaa0baf53aa70b0ec6ec2a6a081beafce42fbef670b5bc25e0588945dad7 |
|
MD5 | d8c68ae9c22ab1068cf6e5dec1022c9a |
|
BLAKE2b-256 | 4902f8b97d9f372933da6190fdca7009a7e9a10a3ae8203e854892af4558027e |