Skip to main content

docstring_parser_swig

Fork of docstring_parser with Swig autodoc support. Check CHANGELOG.md to see the fork changes.

Includes a script (gen_stub.py) that takes a module generated by Swig and generates a .pyi file with type hints. Currently %feature("autodoc", "1") and Doxygen (translated to reStructuredText by Swig) are supported.

Also available on PyPI: pip install docstring_parser_swig

docstring_parser

Parse Python docstrings. Currently support ReST, Google, Numpydoc-style and Epydoc docstrings.

Example usage:

>>> from docstring_parser import parse
>>>
>>>
>>> docstring = parse(
...     '''
...     Short description
...
...     Long description spanning multiple lines
...     - First line
...     - Second line
...     - Third line
...
...     :param name: description 1
...     :param int priority: description 2
...     :param str sender: description 3
...     :raises ValueError: if name is invalid
...     ''')
>>>
>>> docstring.long_description
'Long description spanning multiple lines\n- First line\n- Second line\n- Third line'
>>> docstring.params[1].arg_name
'priority'
>>> docstring.raises[0].type_name
'ValueError'

Read API Documentation.

Installation

Installation using pip

pip install docstring_parser

# or if you want to install it in a virtual environment

python -m venv venv # create environment
source venv/bin/activate # activate environment
python -m pip install docstring_parser

Installation using conda

  1. Download and install miniconda or anaconda
  2. Install the package from the conda-forge channel via:
  • conda install -c conda-forge docstring_parser
  • or create a new conda environment via conda create -n my-new-environment -c conda-forge docstring_parser

Contributing

To set up the project:

git clone https://github.com/rr-/docstring_parser.git
cd docstring_parser

python -m venv venv  # create environment
source venv/bin/activate  # activate environment

pip install -e ".[dev]"  # install as editable
pre-commit install  # make sure pre-commit is setup

To run tests:

source venv/bin/activate
pytest

Release files for docstring_parser_swig 0.0.3

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_parser_swig 0.0.3
File Size Uploaded
docstring_parser_swig-0.0.3.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docstring_parser_swig 0.0.3
File Interpreter ABI Platform
docstring_parser_swig-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 51.3 kB

Release files / docstring_parser_swig-0.0.3.tar.gz

Download URL docstring_parser_swig-0.0.3.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
98147668cd9e8f2e394d9b1c9bdb40f6cbb0c7ab3b2d591cc4672937b1854361
BLAKE2b-256 checksum
How to use checksums
7cb4a9581fb7b8c1ad8b01d6afb4b471e175590e6e5566dff0e257a5d9fe3994
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.11

Release files / docstring_parser_swig-0.0.3-py3-none-any.whl

Download URL docstring_parser_swig-0.0.3-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f55dc4ae65e511f89ae58e5d548e6f437d68abe42b40e0fa6ddf129e040705a5
BLAKE2b-256 checksum
How to use checksums
454d8e5b8373a6b6759d81ff8477c0c951c5501d4767fb29ae690e8ea1c78833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.11

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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