Skip to main content

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:

  1. Import the specified package
  2. Extract docstrings from all classes, functions, and modules
  3. 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)

Source distribution for docstring2json 0.0.10
File Size Uploaded
docstring2json-0.0.10.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docstring2json 0.0.10
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page