Merge your config files and set parameters from the command line in a simple way.
Project description
Docstripy - Convert any docstring to any format docstring
Transform your python docstrings with the format you want :sparkles:
Support Nympydoc, Google and ReStructuredText as output styles. The input style should be either Numpy, Google, ReST or even a mix of both.
How to use
Install the library via pip:
pip install git+https://github.com/valentingol/docstripy
Use it like that to write the files in place. Set a directory path to transform all python files in it.
docstripy <dir-or-file_path> -s=<style> -o=<output_path>
Available styles (style
) are:
- "numpy": Numpy doc style (default)
- "google": Google style
- "rest": ReST style
Cool features
Overwrite the files directly
You can use the -w
(or --overwrite
) option to write the files in place.
docstripy <dir-or-file_path> -s=<style> -w
Note: The module takes into account the fonction definitions. If the definition of the function bring new information, this will be added to the docstring. In case of a conflict, the information in the function definition will be prioritized. It means that docstripy will automatically update your docstring if you update your functions!
Max line length
You can control the max line length of the docstring with the --len
option.
By default, there is no limit. The line lenght take into account the indentation
found in the file.
2 spaces indentation
If your files are indented with 2 spaces, you can use the --n_indent=2
option to
the command line.
docstripy <dir-or-file_path> -s=<style> --n_indent=2
Note that the default value is 4 spaces but you can set any value you want.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for docstripy-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77913a32b42f14cdc329ff47000a535397b2650953a53215893e936caba2241b |
|
MD5 | 4dc2401caf0e96c09ca062e93094816a |
|
BLAKE2b-256 | 89ed22937eec36d0bb24efb6ca94bccb5cbe9d5e63cb0500a269663316b71cd5 |