Google Docstring to JSON Converter
A tool that converts Python package docstrings to JSON files.
License
This software is licensed under a custom license agreement. The Albumentations Team and their official contributors have free access to use this software for their projects. All other users must obtain a paid license.
For licensing inquiries, please contact: Vladimir Iglovikov (iglovikov@gmail.com)
See the LICENSE file for full details.
Features
- Converts Google-style docstrings to JSON format
- Maintains the original package structure in the output
- Supports both class and function documentation
- Handles module-level docstrings
- Preserves code examples and formatting
- Supports complex type definitions with interactive display
Installation
pip install docstring2json
Usage
python -m src.docstring2json.__main__ --package-name PACKAGE_NAME --output-dir OUTPUT_DIR
or:
docstring2json --package-name PACKAGE_NAME --output-dir OUTPUT_DIR
This will:
- Import the specified package
- Extract docstrings from all classes, functions, and modules
- Write JSON files for each module with proper routing
Output Structure
The tool creates a directory structure that matches the input package:
output_dir/
module1/
file1/
data.json
file2/
data.json
module2/
submodule/
file2/
data.json
Each data.json file contains:
- Module name and description
- Parameter descriptions with type information
- Return values and exceptions with proper formatting
- Code examples with syntax highlighting
- References and links to related documentation
Development
# Install dependencies
pip install -e .
# Run tests
pytest
# Run pre-commit hooks
pre-commit run --all-files
Metadata
Release files for docstring2json 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| docstring2json-0.0.10.tar.gz | 14.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docstring2json-0.0.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.1 kB
Release files / docstring2json-0.0.10.tar.gz
| Download URL | docstring2json-0.0.10.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdbbb67aa47645ca0637c77caa4b616fb02ac9b9ba49e3ed852c00dac6384fce
|
|
BLAKE2b-256 checksum How to use checksums |
8faec4859e8e70a57c6524f94b8b67f0da2328ceb78e99cdf820cb900d4a9c40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / docstring2json-0.0.10-py3-none-any.whl
| Download URL | docstring2json-0.0.10-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f399b2d32599586b3c5b4d22c2b5e39ffcbfd2e00c18c0abb2923645ced35d5
|
|
BLAKE2b-256 checksum How to use checksums |
32f8bbdbe5654787efbd8688acbe7438aefe54e1b22bf395f4e1428bc0de89a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|