docstring-generator-ext 0.0.33__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docstring_generator_ext-1.0.2/MANIFEST.in +25 -0
- docstring_generator_ext-1.0.2/PKG-INFO +99 -0
- docstring_generator_ext-1.0.2/README.md +85 -0
- docstring_generator_ext-1.0.2/docstring_generator_ext.egg-info/PKG-INFO +99 -0
- {docstring_generator_ext-0.0.33 → docstring_generator_ext-1.0.2}/docstring_generator_ext.egg-info/SOURCES.txt +3 -2
- docstring_generator_ext-1.0.2/docstring_generator_ext.egg-info/requires.txt +1 -0
- docstring_generator_ext-1.0.2/pyproject.toml +45 -0
- docstring_generator_ext-1.0.2/setup.py +21 -0
- docstring_generator_ext-1.0.2/src/docstringFormat.cpp +956 -0
- docstring_generator_ext-1.0.2/src/docstringFormat.hpp +102 -0
- docstring_generator_ext-0.0.33/PKG-INFO +0 -26
- docstring_generator_ext-0.0.33/README.md +0 -8
- docstring_generator_ext-0.0.33/docstring_generator_ext.egg-info/PKG-INFO +0 -26
- docstring_generator_ext-0.0.33/docstring_generator_ext.egg-info/not-zip-safe +0 -1
- docstring_generator_ext-0.0.33/docstring_generator_ext.egg-info/requires.txt +0 -3
- docstring_generator_ext-0.0.33/pyproject.toml +0 -3
- docstring_generator_ext-0.0.33/setup.py +0 -55
- docstring_generator_ext-0.0.33/src/docstringFormat.cpp +0 -1145
- {docstring_generator_ext-0.0.33 → docstring_generator_ext-1.0.2}/docstring_generator_ext.egg-info/dependency_links.txt +0 -0
- {docstring_generator_ext-0.0.33 → docstring_generator_ext-1.0.2}/docstring_generator_ext.egg-info/top_level.txt +0 -0
- {docstring_generator_ext-0.0.33 → docstring_generator_ext-1.0.2}/setup.cfg +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# What to include
|
|
2
|
+
include README.md
|
|
3
|
+
include pyproject.toml
|
|
4
|
+
include setup.py
|
|
5
|
+
include src/docstringFormat.cpp
|
|
6
|
+
include src/docstringFormat.hpp
|
|
7
|
+
|
|
8
|
+
# What to exclude
|
|
9
|
+
prune src/cmake-build-debug
|
|
10
|
+
prune src/CMakeFiles
|
|
11
|
+
prune src/extern
|
|
12
|
+
prune src/tests
|
|
13
|
+
prune dist
|
|
14
|
+
prune build
|
|
15
|
+
prune .venv
|
|
16
|
+
prune venv
|
|
17
|
+
prune .idea
|
|
18
|
+
prune .github
|
|
19
|
+
prune .git
|
|
20
|
+
|
|
21
|
+
# Safety nets
|
|
22
|
+
global-exclude *.o *.so *.dylib *.dll *.pyc *.pyo
|
|
23
|
+
global-exclude __pycache__
|
|
24
|
+
global-exclude .DS_Store
|
|
25
|
+
global-exclude *.egg-info
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docstring_generator_ext
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Generate Docstrings with type-hint information.
|
|
5
|
+
Author-email: FelixTheC <fberndt87@gmail.com>
|
|
6
|
+
Classifier: Environment :: Console
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Topic :: Utilities
|
|
9
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Requires-Python: >=3.13
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: pybind11>=3.0.4
|
|
14
|
+
|
|
15
|
+
# Docstring Generator Extension
|
|
16
|
+
|
|
17
|
+
[](https://github.com/FelixTheC/docstring_generator_ext/actions/workflows/cpp-tests.yml)
|
|
18
|
+
[](https://github.com/FelixTheC/docstring_generator_ext/actions/workflows/check-build-ext.yml)
|
|
19
|
+
[](https://pypi.org/project/docstring_generator_ext/)
|
|
20
|
+
[](https://pypi.org/project/docstring_generator_ext/)
|
|
21
|
+
[](https://opensource.org/licenses/MIT)
|
|
22
|
+
|
|
23
|
+
`docstring_generator_ext` is a high-performance Python extension written in C++ (using pybind11) designed to automatically generate and inject docstrings into Python source files. It leverages Python's `ast` module to extract type-hint information and function signatures to create well-formatted docstrings in various styles.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Automatic Docstring Injection**: Parses Python files and inserts docstrings for functions and methods.
|
|
28
|
+
- **Type-Hint Awareness**: Extracts type information from annotations and default values.
|
|
29
|
+
- **Multiple Styles**: Supports popular docstring formats:
|
|
30
|
+
- **reST** (reStructuredText)
|
|
31
|
+
- **Google** style
|
|
32
|
+
- **NumPy** style
|
|
33
|
+
- **High Performance**: Core logic implemented in C++ for fast processing.
|
|
34
|
+
- **Preserves Existing Content**: Can update existing docstrings while trying to preserve manually added descriptions (using a special `$` marker convention).
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
### Prerequisites
|
|
39
|
+
|
|
40
|
+
- Python 3.13 or higher
|
|
41
|
+
- A C++ compiler with C++20 support (e.g., GCC, Clang, or MSVC)
|
|
42
|
+
- `pybind11`
|
|
43
|
+
|
|
44
|
+
### Building from Source
|
|
45
|
+
|
|
46
|
+
1. Clone the repository:
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/FelixTheC/docstring_generator_ext.git
|
|
49
|
+
cd docstring_generator_ext
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. Install the `build` package:
|
|
53
|
+
```bash
|
|
54
|
+
pip install build
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
3. Build the package:
|
|
58
|
+
```bash
|
|
59
|
+
python -m build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
4. Install the built wheel:
|
|
63
|
+
```bash
|
|
64
|
+
pip install dist/docstring_generator_ext-*.whl
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
After installation, you can use the extension in your Python scripts:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
import docstring_generator_ext
|
|
73
|
+
|
|
74
|
+
# Path to the Python file you want to process
|
|
75
|
+
file_path = "path/to/your_script.py"
|
|
76
|
+
|
|
77
|
+
# Choose a style: GOOGLE, NUMPY, or reST
|
|
78
|
+
style = docstring_generator_ext.DocstringFormatStyle.GOOGLE
|
|
79
|
+
|
|
80
|
+
# Generate and inject docstrings
|
|
81
|
+
docstring_generator_ext.parse_file(file_path, style)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Docstring Styles
|
|
85
|
+
|
|
86
|
+
The extension provides an enum `DocstringFormatStyle` to choose the desired output:
|
|
87
|
+
|
|
88
|
+
- `docstring_generator_ext.DocstringFormatStyle.reST`
|
|
89
|
+
- `docstring_generator_ext.DocstringFormatStyle.GOOGLE`
|
|
90
|
+
- `docstring_generator_ext.DocstringFormatStyle.NUMPY`
|
|
91
|
+
|
|
92
|
+
## Authors
|
|
93
|
+
|
|
94
|
+
- **FelixTheC**
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
|
|
99
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Docstring Generator Extension
|
|
2
|
+
|
|
3
|
+
[](https://github.com/FelixTheC/docstring_generator_ext/actions/workflows/cpp-tests.yml)
|
|
4
|
+
[](https://github.com/FelixTheC/docstring_generator_ext/actions/workflows/check-build-ext.yml)
|
|
5
|
+
[](https://pypi.org/project/docstring_generator_ext/)
|
|
6
|
+
[](https://pypi.org/project/docstring_generator_ext/)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
`docstring_generator_ext` is a high-performance Python extension written in C++ (using pybind11) designed to automatically generate and inject docstrings into Python source files. It leverages Python's `ast` module to extract type-hint information and function signatures to create well-formatted docstrings in various styles.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Automatic Docstring Injection**: Parses Python files and inserts docstrings for functions and methods.
|
|
14
|
+
- **Type-Hint Awareness**: Extracts type information from annotations and default values.
|
|
15
|
+
- **Multiple Styles**: Supports popular docstring formats:
|
|
16
|
+
- **reST** (reStructuredText)
|
|
17
|
+
- **Google** style
|
|
18
|
+
- **NumPy** style
|
|
19
|
+
- **High Performance**: Core logic implemented in C++ for fast processing.
|
|
20
|
+
- **Preserves Existing Content**: Can update existing docstrings while trying to preserve manually added descriptions (using a special `$` marker convention).
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
### Prerequisites
|
|
25
|
+
|
|
26
|
+
- Python 3.13 or higher
|
|
27
|
+
- A C++ compiler with C++20 support (e.g., GCC, Clang, or MSVC)
|
|
28
|
+
- `pybind11`
|
|
29
|
+
|
|
30
|
+
### Building from Source
|
|
31
|
+
|
|
32
|
+
1. Clone the repository:
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/FelixTheC/docstring_generator_ext.git
|
|
35
|
+
cd docstring_generator_ext
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Install the `build` package:
|
|
39
|
+
```bash
|
|
40
|
+
pip install build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. Build the package:
|
|
44
|
+
```bash
|
|
45
|
+
python -m build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
4. Install the built wheel:
|
|
49
|
+
```bash
|
|
50
|
+
pip install dist/docstring_generator_ext-*.whl
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
After installation, you can use the extension in your Python scripts:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import docstring_generator_ext
|
|
59
|
+
|
|
60
|
+
# Path to the Python file you want to process
|
|
61
|
+
file_path = "path/to/your_script.py"
|
|
62
|
+
|
|
63
|
+
# Choose a style: GOOGLE, NUMPY, or reST
|
|
64
|
+
style = docstring_generator_ext.DocstringFormatStyle.GOOGLE
|
|
65
|
+
|
|
66
|
+
# Generate and inject docstrings
|
|
67
|
+
docstring_generator_ext.parse_file(file_path, style)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Docstring Styles
|
|
71
|
+
|
|
72
|
+
The extension provides an enum `DocstringFormatStyle` to choose the desired output:
|
|
73
|
+
|
|
74
|
+
- `docstring_generator_ext.DocstringFormatStyle.reST`
|
|
75
|
+
- `docstring_generator_ext.DocstringFormatStyle.GOOGLE`
|
|
76
|
+
- `docstring_generator_ext.DocstringFormatStyle.NUMPY`
|
|
77
|
+
|
|
78
|
+
## Authors
|
|
79
|
+
|
|
80
|
+
- **FelixTheC**
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
|
|
85
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docstring_generator_ext
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Generate Docstrings with type-hint information.
|
|
5
|
+
Author-email: FelixTheC <fberndt87@gmail.com>
|
|
6
|
+
Classifier: Environment :: Console
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Topic :: Utilities
|
|
9
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Requires-Python: >=3.13
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: pybind11>=3.0.4
|
|
14
|
+
|
|
15
|
+
# Docstring Generator Extension
|
|
16
|
+
|
|
17
|
+
[](https://github.com/FelixTheC/docstring_generator_ext/actions/workflows/cpp-tests.yml)
|
|
18
|
+
[](https://github.com/FelixTheC/docstring_generator_ext/actions/workflows/check-build-ext.yml)
|
|
19
|
+
[](https://pypi.org/project/docstring_generator_ext/)
|
|
20
|
+
[](https://pypi.org/project/docstring_generator_ext/)
|
|
21
|
+
[](https://opensource.org/licenses/MIT)
|
|
22
|
+
|
|
23
|
+
`docstring_generator_ext` is a high-performance Python extension written in C++ (using pybind11) designed to automatically generate and inject docstrings into Python source files. It leverages Python's `ast` module to extract type-hint information and function signatures to create well-formatted docstrings in various styles.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Automatic Docstring Injection**: Parses Python files and inserts docstrings for functions and methods.
|
|
28
|
+
- **Type-Hint Awareness**: Extracts type information from annotations and default values.
|
|
29
|
+
- **Multiple Styles**: Supports popular docstring formats:
|
|
30
|
+
- **reST** (reStructuredText)
|
|
31
|
+
- **Google** style
|
|
32
|
+
- **NumPy** style
|
|
33
|
+
- **High Performance**: Core logic implemented in C++ for fast processing.
|
|
34
|
+
- **Preserves Existing Content**: Can update existing docstrings while trying to preserve manually added descriptions (using a special `$` marker convention).
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
### Prerequisites
|
|
39
|
+
|
|
40
|
+
- Python 3.13 or higher
|
|
41
|
+
- A C++ compiler with C++20 support (e.g., GCC, Clang, or MSVC)
|
|
42
|
+
- `pybind11`
|
|
43
|
+
|
|
44
|
+
### Building from Source
|
|
45
|
+
|
|
46
|
+
1. Clone the repository:
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/FelixTheC/docstring_generator_ext.git
|
|
49
|
+
cd docstring_generator_ext
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. Install the `build` package:
|
|
53
|
+
```bash
|
|
54
|
+
pip install build
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
3. Build the package:
|
|
58
|
+
```bash
|
|
59
|
+
python -m build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
4. Install the built wheel:
|
|
63
|
+
```bash
|
|
64
|
+
pip install dist/docstring_generator_ext-*.whl
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
After installation, you can use the extension in your Python scripts:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
import docstring_generator_ext
|
|
73
|
+
|
|
74
|
+
# Path to the Python file you want to process
|
|
75
|
+
file_path = "path/to/your_script.py"
|
|
76
|
+
|
|
77
|
+
# Choose a style: GOOGLE, NUMPY, or reST
|
|
78
|
+
style = docstring_generator_ext.DocstringFormatStyle.GOOGLE
|
|
79
|
+
|
|
80
|
+
# Generate and inject docstrings
|
|
81
|
+
docstring_generator_ext.parse_file(file_path, style)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Docstring Styles
|
|
85
|
+
|
|
86
|
+
The extension provides an enum `DocstringFormatStyle` to choose the desired output:
|
|
87
|
+
|
|
88
|
+
- `docstring_generator_ext.DocstringFormatStyle.reST`
|
|
89
|
+
- `docstring_generator_ext.DocstringFormatStyle.GOOGLE`
|
|
90
|
+
- `docstring_generator_ext.DocstringFormatStyle.NUMPY`
|
|
91
|
+
|
|
92
|
+
## Authors
|
|
93
|
+
|
|
94
|
+
- **FelixTheC**
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
|
|
99
|
+
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
MANIFEST.in
|
|
1
2
|
README.md
|
|
2
3
|
pyproject.toml
|
|
3
4
|
setup.py
|
|
4
5
|
docstring_generator_ext.egg-info/PKG-INFO
|
|
5
6
|
docstring_generator_ext.egg-info/SOURCES.txt
|
|
6
7
|
docstring_generator_ext.egg-info/dependency_links.txt
|
|
7
|
-
docstring_generator_ext.egg-info/not-zip-safe
|
|
8
8
|
docstring_generator_ext.egg-info/requires.txt
|
|
9
9
|
docstring_generator_ext.egg-info/top_level.txt
|
|
10
|
-
src/docstringFormat.cpp
|
|
10
|
+
src/docstringFormat.cpp
|
|
11
|
+
src/docstringFormat.hpp
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pybind11>=3.0.4
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "docstring_generator_ext"
|
|
3
|
+
version = "1.0.2"
|
|
4
|
+
description = "Generate Docstrings with type-hint information."
|
|
5
|
+
authors = [
|
|
6
|
+
{ name = "FelixTheC", email = "fberndt87@gmail.com" },
|
|
7
|
+
]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.13"
|
|
10
|
+
|
|
11
|
+
classifiers=[
|
|
12
|
+
|
|
13
|
+
"Environment :: Console",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Topic :: Utilities",
|
|
16
|
+
"Topic :: Software Development :: Documentation",
|
|
17
|
+
"Typing :: Typed",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
dependencies = [
|
|
21
|
+
"pybind11>=3.0.4"
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[build-system]
|
|
25
|
+
requires = ["setuptools>=42", "pybind11>=3.0.4"]
|
|
26
|
+
build-backend = "setuptools.build_meta"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools]
|
|
29
|
+
py-modules = []
|
|
30
|
+
packages = []
|
|
31
|
+
include-package-data = false
|
|
32
|
+
|
|
33
|
+
[tool.cibuildwheel]
|
|
34
|
+
build = "cp313-* cp314-*"
|
|
35
|
+
skip = "pp* *musllinux*"
|
|
36
|
+
test-skip = "*"
|
|
37
|
+
|
|
38
|
+
[tool.cibuildwheel.linux]
|
|
39
|
+
archs = ["x86_64"]
|
|
40
|
+
|
|
41
|
+
[tool.cibuildwheel.macos]
|
|
42
|
+
archs = ["x86_64", "arm64"]
|
|
43
|
+
|
|
44
|
+
[tool.cibuildwheel.windows]
|
|
45
|
+
archs = ["AMD64"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Available at setup time due to pyproject.toml
|
|
2
|
+
from setuptools import setup
|
|
3
|
+
try:
|
|
4
|
+
from pybind11.setup_helpers import Pybind11Extension, build_ext
|
|
5
|
+
except ImportError:
|
|
6
|
+
from setuptools import Extension as Pybind11Extension
|
|
7
|
+
build_ext = None
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
ext_modules = [
|
|
11
|
+
Pybind11Extension(
|
|
12
|
+
"docstring_generator_ext",
|
|
13
|
+
["src/docstringFormat.cpp"],
|
|
14
|
+
cxx_std=20,
|
|
15
|
+
),
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
setup(
|
|
19
|
+
ext_modules=ext_modules,
|
|
20
|
+
cmdclass={"build_ext": build_ext} if build_ext else {},
|
|
21
|
+
)
|