Name | docstripy JSON |
Version |
0.7.1
JSON |
| download |
home_page | None |
Summary | Merge your config files and set parameters from the command line in a simple way. |
upload_time | 2024-06-29 20:55:16 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | None |
keywords |
numpy
docstring
numpydoc
python
format
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
# Docstripy - Convert any docstring to any format docstring
Transform your python docstrings to 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.
Python notebook are supported as well!
[![Release](https://img.shields.io/github/v/tag/valentingol/docstripy?label=Pypi&logo=pypi&logoColor=yellow)](https://pypi.org/project/docstripy/)
![PythonVersion](https://img.shields.io/badge/Python-3.7%20%7E%203.11-informational)
[![License](https://img.shields.io/github/license/valentingol/docstripy?color=999)](https://stringfixer.com/fr/MIT_license)
[![Ruff_logo](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![Black_logo](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://github.com/valentingol/docstripy/actions/workflows/ruff.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/ruff.yaml)
[![Flake8](https://github.com/valentingol/docstripy/actions/workflows/flake.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/flake.yaml)
[![MyPy](https://github.com/valentingol/docstripy/actions/workflows/mypy.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/mypy.yaml)
[![PyLint](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/valentingol/5816178f37cee2c013f2e656666c898a/raw/npdocify_pylint.json)](https://github.com/valentingol/docstripy/actions/workflows/pylint.yaml)
[![Tests](https://github.com/valentingol/docstripy/actions/workflows/tests.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/tests.yaml)
[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/valentingol/6fd638b90ac10eced712b8d5ca83b04f/raw/npdocify_tests.json)](https://github.com/valentingol/docstripy/actions/workflows/tests.yaml)
[![Documentation Status](https://readthedocs.org/projects/docstripy/badge/?version=latest)](https://docstripy.readthedocs.io/en/latest/?badge=latest)
## Documentation
The documentation :memo: is available at
[docstripy.readthedocs.io](https://docstripy.readthedocs.io/en/latest/).
## How to use
Install the library via pip:
```bash
pip install docstripy
```
Use it like that to write the files in place.
Set a directory path to transform all python files in it.
```bash
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
See examples in the
[documentation](https://docstripy.readthedocs.io/en/latest/howto.html).
## Cool features
See examples of the features in the
[documentation](https://docstripy.readthedocs.io/en/latest/features.html).
### Overwrite the files directly
You can use the `-w` (or `--overwrite`) option to write the files in place.
```bash
docstripy <dir-or-file_path> -s=<style> -w
```
You can find an end-to-end example in the
[documentation](https://docstripy.readthedocs.io/en/latest/howto.html).
*Notes*:
1) **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!
1) If the old docstring not already contains information on parameters and/or
return elements, the output docstring will not specify those elements either.
However, if the function definition contains more information, the docstring will
be updated with all the corresponding information available in the signature.
### 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. It does not applied on wild sections such as "Examples" or "Notes".
### 2 spaces indentation
If your files are indented with 2 spaces, you can use the `--n_indent=2` option to
the command line.
```bash
docstripy <dir-or-file_path> -s=<style> -w --n_indent=2
```
Note that the default value is 4 spaces but you can set any value you want.
### Create a short docstring when missing
When a function has no docstring, a short one will be created based on
the function name. You can disable this feature with the `--noadd` option
in command line.
```bash
docstripy <dir-or-file_path> -s=<style> -w --noadd
```
### Prevent type hinting
You can disable the type hinting in the docstring with the `--notype` option.
```bash
docstripy <dir-or-file_path> -s=<style> -w --notype
```
### Class docstring
The class docstring is updated based on the class definition with the signature
of `__init__` method.
Raw data
{
"_id": null,
"home_page": null,
"name": "docstripy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "numpy, docstring, numpydoc, python, format",
"author": null,
"author_email": "Valentin Goldite <valentin.goldite@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f0/67/d6766be98546fc0f402d58f363efeef197aba94e2d5341f4ec02ada56bba/docstripy-0.7.1.tar.gz",
"platform": null,
"description": "# Docstripy - Convert any docstring to any format docstring\n\nTransform your python docstrings to the format you want :sparkles:\n\nSupport Nympydoc, Google and ReStructuredText as output styles.\nThe input style should be either Numpy, Google, ReST or even a mix of both.\n\nPython notebook are supported as well!\n\n[![Release](https://img.shields.io/github/v/tag/valentingol/docstripy?label=Pypi&logo=pypi&logoColor=yellow)](https://pypi.org/project/docstripy/)\n![PythonVersion](https://img.shields.io/badge/Python-3.7%20%7E%203.11-informational)\n[![License](https://img.shields.io/github/license/valentingol/docstripy?color=999)](https://stringfixer.com/fr/MIT_license)\n\n[![Ruff_logo](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)\n[![Black_logo](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[![Ruff](https://github.com/valentingol/docstripy/actions/workflows/ruff.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/ruff.yaml)\n[![Flake8](https://github.com/valentingol/docstripy/actions/workflows/flake.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/flake.yaml)\n[![MyPy](https://github.com/valentingol/docstripy/actions/workflows/mypy.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/mypy.yaml)\n[![PyLint](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/valentingol/5816178f37cee2c013f2e656666c898a/raw/npdocify_pylint.json)](https://github.com/valentingol/docstripy/actions/workflows/pylint.yaml)\n\n[![Tests](https://github.com/valentingol/docstripy/actions/workflows/tests.yaml/badge.svg)](https://github.com/valentingol/docstripy/actions/workflows/tests.yaml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/valentingol/6fd638b90ac10eced712b8d5ca83b04f/raw/npdocify_tests.json)](https://github.com/valentingol/docstripy/actions/workflows/tests.yaml)\n[![Documentation Status](https://readthedocs.org/projects/docstripy/badge/?version=latest)](https://docstripy.readthedocs.io/en/latest/?badge=latest)\n\n## Documentation\n\nThe documentation :memo: is available at\n[docstripy.readthedocs.io](https://docstripy.readthedocs.io/en/latest/).\n\n## How to use\n\nInstall the library via pip:\n\n```bash\npip install docstripy\n```\n\nUse it like that to write the files in place.\nSet a directory path to transform all python files in it.\n\n```bash\ndocstripy <dir-or-file_path> -s=<style> -o=<output_path>\n```\n\nAvailable styles (`style`) are:\n\n* \"numpy\": Numpy doc style (default)\n* \"google\": Google style\n* \"rest\": ReST style\n\nSee examples in the\n[documentation](https://docstripy.readthedocs.io/en/latest/howto.html).\n\n## Cool features\n\nSee examples of the features in the\n[documentation](https://docstripy.readthedocs.io/en/latest/features.html).\n\n### Overwrite the files directly\n\nYou can use the `-w` (or `--overwrite`) option to write the files in place.\n\n```bash\ndocstripy <dir-or-file_path> -s=<style> -w\n```\n\nYou can find an end-to-end example in the\n[documentation](https://docstripy.readthedocs.io/en/latest/howto.html).\n\n*Notes*:\n\n1) **The module takes into account the fonction definitions**.\nIf the definition of the function bring new information, this will be added to the docstring.\nIn case of a conflict, the information in **the function definition will be prioritized**.\nIt means that docstripy will automatically update your docstring if you update your functions!\n1) If the old docstring not already contains information on parameters and/or\nreturn elements, the output docstring will not specify those elements either.\nHowever, if the function definition contains more information, the docstring will\nbe updated with all the corresponding information available in the signature.\n\n### Max line length\n\nYou can control the max line length of the docstring with the `--len` option.\nBy default, there is no limit. The line lenght take into account the indentation\nfound in the file. It does not applied on wild sections such as \"Examples\" or \"Notes\".\n\n### 2 spaces indentation\n\nIf your files are indented with 2 spaces, you can use the `--n_indent=2` option to\nthe command line.\n\n```bash\ndocstripy <dir-or-file_path> -s=<style> -w --n_indent=2\n```\n\nNote that the default value is 4 spaces but you can set any value you want.\n\n### Create a short docstring when missing\n\nWhen a function has no docstring, a short one will be created based on\nthe function name. You can disable this feature with the `--noadd` option\nin command line.\n\n```bash\ndocstripy <dir-or-file_path> -s=<style> -w --noadd\n```\n\n### Prevent type hinting\n\nYou can disable the type hinting in the docstring with the `--notype` option.\n\n```bash\ndocstripy <dir-or-file_path> -s=<style> -w --notype\n```\n\n### Class docstring\n\nThe class docstring is updated based on the class definition with the signature\nof `__init__` method.\n",
"bugtrack_url": null,
"license": null,
"summary": "Merge your config files and set parameters from the command line in a simple way.",
"version": "0.7.1",
"project_urls": {
"Source": "https://github.com/valentingol/docstripy"
},
"split_keywords": [
"numpy",
" docstring",
" numpydoc",
" python",
" format"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ba7a8c9e4638cd69da0d7ac741b05bcff8a56c1771b50dbbf81a9ec243a9b516",
"md5": "5eebad3a4a128c5e62f6bb07d62a2084",
"sha256": "efe55ae0740228ccc12f5cbdddab74262c7c659d6609e648052c047c0c2ab4c6"
},
"downloads": -1,
"filename": "docstripy-0.7.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5eebad3a4a128c5e62f6bb07d62a2084",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 30599,
"upload_time": "2024-06-29T20:55:14",
"upload_time_iso_8601": "2024-06-29T20:55:14.795295Z",
"url": "https://files.pythonhosted.org/packages/ba/7a/8c9e4638cd69da0d7ac741b05bcff8a56c1771b50dbbf81a9ec243a9b516/docstripy-0.7.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f067d6766be98546fc0f402d58f363efeef197aba94e2d5341f4ec02ada56bba",
"md5": "7ad12a7ec23b111a191a996cd7d602ee",
"sha256": "a172ba48010d929b9e2df6432f1c405b353ef2f6a63a7c1f2a7e28136e966dae"
},
"downloads": -1,
"filename": "docstripy-0.7.1.tar.gz",
"has_sig": false,
"md5_digest": "7ad12a7ec23b111a191a996cd7d602ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 53630,
"upload_time": "2024-06-29T20:55:16",
"upload_time_iso_8601": "2024-06-29T20:55:16.239426Z",
"url": "https://files.pythonhosted.org/packages/f0/67/d6766be98546fc0f402d58f363efeef197aba94e2d5341f4ec02ada56bba/docstripy-0.7.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-29 20:55:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "valentingol",
"github_project": "docstripy",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "docstripy"
}