You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

docstring-to-markdown

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docstring-to-markdown

On the fly conversion of Python docstrings to markdown

0.16
pipPyPI
Maintainers
1

docstring-to-markdown

tests CodeQL pypi-version

On the fly conversion of Python docstrings to markdown

  • Python 3.7+ (tested on 3.8 up to 3.13)
  • can recognise reStructuredText and convert multiple of its features to Markdown
  • since v0.13 includes initial support for Google-formatted docstrings

Installation

pip install docstring-to-markdown

Example

Convert reStructuredText:

>>> import docstring_to_markdown
>>> docstring_to_markdown.convert(':math:`\\sum`')
'$\\sum$'

When given the format cannot be recognised an exception will be raised:

>>> docstring_to_markdown.convert('\\sum')
Traceback (most recent call last):
    raise UnknownFormatError()
docstring_to_markdown.UnknownFormatError

Extensibility

docstring_to_markdown entry point group allows to add custom converters which follow the Converter protocol. The built-in converters can be customized by providing entry point with matching name.

Development

pip install -e .
pytest

Keywords

Docstring

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts