Google Docstring to TSX Converter
A tool that converts Python package docstrings to TSX files for Next.js documentation, with a focus on generating beautiful, interactive documentation.
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 TSX format with modern UI components
- Preserves type information and parameter descriptions with syntax highlighting
- Maintains the original package structure in the output
- Generates source code with toggle functionality for each class/function
- Supports both class and function documentation
- Creates a table of contents for easy navigation
- Handles module-level docstrings
- Preserves code examples and formatting
- Supports complex type definitions with interactive display
- Generates responsive, dark-themed documentation
Installation
pip install google-docstring-2tsx
Usage
python -m src.docstring_2tsx.__main__ --package-name PACKAGE_NAME --output-dir OUTPUT_DIR
or:
docstring2tsx --package-name PACKAGE_NAME --output-dir OUTPUT_DIR
This will:
- Import the specified package
- Extract docstrings from all classes, functions, and modules
- Convert them to TSX format with modern UI components
- Create a directory structure matching the package
- Write TSX files for each module with proper routing
Output Structure
The tool creates a directory structure that matches the input package:
output_dir/
module1/
page.tsx
module2/
submodule/
page.tsx
Each page.tsx file contains:
- Module name and description in a styled container
- Table of contents with links to classes and functions
- Interactive source code display with toggle functionality
- 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 google-docstring-2tsx 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| google_docstring_2tsx-0.0.5.tar.gz | 13.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| google_docstring_2tsx-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.2 kB
Release files / google_docstring_2tsx-0.0.5.tar.gz
| Download URL | google_docstring_2tsx-0.0.5.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9998cd544266ca8c6a54a5f79ab8b8dff8a373ac2bec8d115b1a44de8f34c709
|
|
BLAKE2b-256 checksum How to use checksums |
98dc27c2adb2e238ff8058547c79b2d946a2ab0919d1c33bce1ce89a626484af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Release files / google_docstring_2tsx-0.0.5-py3-none-any.whl
| Download URL | google_docstring_2tsx-0.0.5-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1504e73a971720f21ea1eea41a6759259739a8e65c098e9bdecc12e225d605f3
|
|
BLAKE2b-256 checksum How to use checksums |
dfcbc2fc50bef98642778d4c6737e118abd48c6cc664c00b4a99305683d9ac11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|