• Stars
    star
    210
  • Rank 187,585 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Parse Python docstrings in various flavors.

docstring_parser

Build

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:

pip install --user poetry

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

poetry install
poetry run pre-commit install

To run tests:

poetry run pytest

More Repositories

1

szurubooru

Image board engine, Danbooru-style.
Python
674
star
2

screeninfo

Fetch location and size of physical screens.
Python
197
star
3

malgraph4

MALgraph: statistics service for MyAnimeList.net users.
PHP
158
star
4

pq-cli

Progress Quest: the CLI edition
Python
132
star
5

drill

A CLI program for learning things through spaced repetition. 🐶
Python
94
star
6

shot

Make screenshots from CLI.
C
90
star
7

CRC-manipulator

Change CRC checksums of your files.
C++
87
star
8

ida-images

Image preview plugin for IDA disassembler.
Python
56
star
9

10ff

Typing tests in CLI
Python
51
star
10

Tomb1Main

Open source re-implementation of Tomb Raider 1 (1996), along with additional enhancements and bugfixes
C
51
star
11

urwid_readline

readline text edit for urwid
Python
27
star
12

pycrcmanip

Change CRC checksums of your files, in Python.
Python
18
star
13

fpl_reader

foobar2000 .fpl playlists reader.
Python
18
star
14

dotfiles

It's not life, it's GNU/life.
Python
15
star
15

vim-hexdec

Convert hexadecimal numbers to decimal and vice versa.
Vim Script
14
star
16

Tomb3Main

C
14
star
17

TRCustoms

A website dedicated to custom levels for classic Tomb Raider games.
TypeScript
8
star
18

ftpfs

FTP over FUSE with Python
Python
7
star
19

termi

Images in your terminal, again.
Python
7
star
20

hexvi

A hex editor inspired by Vim.
Python
6
star
21

tsujidou

Toolkit for translating Tsujidou-san no Jun'ai Road
C
6
star
22

pyindexer

Simple Python file indexer for web servers
Python
5
star
23

pyxdotool

python port of xdotool
Python
4
star
24

ALAS

An utility that lets you run Japanese games.
C#
3
star
25

mdsm

Send mails directly to your local maildir
Python
3
star
26

pyqtcolordialog

Drop-in replacement of QColorDialog for PyQt5
Python
2
star
27

brailleimg

Python
2
star
28

soladm

CLI Soldat Admin Client
Python
2
star
29

bk

Change desktop background in GNU/Linux and Windows from CLI, with fancy features.
Python
2
star
30

rr-

1
star
31

python_template

Python
1
star
32

aoc

Advent of Code solutions
Python
1
star