A tool to convert Google-style docstrings to JSON format
Project description
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docstring2json-0.0.10.tar.gz.
File metadata
- Download URL: docstring2json-0.0.10.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdbbb67aa47645ca0637c77caa4b616fb02ac9b9ba49e3ed852c00dac6384fce
|
|
| MD5 |
8d98556ffe68e02950c50d50e36316e7
|
|
| BLAKE2b-256 |
8faec4859e8e70a57c6524f94b8b67f0da2328ceb78e99cdf820cb900d4a9c40
|
File details
Details for the file docstring2json-0.0.10-py3-none-any.whl.
File metadata
- Download URL: docstring2json-0.0.10-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f399b2d32599586b3c5b4d22c2b5e39ffcbfd2e00c18c0abb2923645ced35d5
|
|
| MD5 |
b91abc6d0999f1c8a34aba2ebae9db06
|
|
| BLAKE2b-256 |
32f8bbdbe5654787efbd8688acbe7438aefe54e1b22bf395f4e1428bc0de89a2
|