This chapter covers the core features and capabilities of API Documentation Toolkit.
| Directory | Contents |
|---|---|
src/ | Three runnable Python tools: OpenAPI generator, changelog differ, portal builder |
templates/ | Developer portal HTML template, Redoc CSS theme, changelog markdown template |
examples/ | Sample OpenAPI spec + two versioned specs for testing the changelog differ |
docs/ | Quick start guide + detailed explanation of how the generators work |
tests/ | Unit tests for the changelog generator (stdlib unittest) |
Follow this guide to get API Documentation Toolkit up and running in your environment.
# Run the generator on a sample handler file
python3 src/openapi_from_code.py
# Or import and use in your own script
python3 -c "
from src.openapi_from_code import OpenAPIGenerator
gen = OpenAPIGenerator(title='My API', version='1.0.0')
gen.add_route('GET', '/users', summary='List users', tags=['Users'])
print(gen.to_yaml())
"# Diff the included v1 and v2 sample specs
python3 src/changelog_gen.py examples/two-versioned-specs/v1.yaml examples/two-versioned-specs/v2.yaml
# Output is a structured markdown changelog# Generate a developer portal from an OpenAPI spec
python3 src/portal_build.py examples/sample-openapi.yaml --output portal.html
# Open portal.html in your browserapi-documentation-toolkit/
├── README.md # This file
├── LICENSE # MIT License
├── src/
│ ├── openapi_from_code.py # Generate OpenAPI from annotated Python handlers
│ ├── changelog_gen.py # Diff two OpenAPI specs -> markdown changelog
│ └── portal_build.py # Build static HTML developer portal
├── templates/
│ ├── developer-portal.html # HTML template with CSS for the portal
│ ├── redoc-theme.css # Custom Redoc CSS theme
│ └── changelog-template.md # Markdown template for API changelogs
├── examples/
│ ├── sample-openapi.yaml # Sample OpenAPI spec for portal demo
│ └── two-versioned-specs/
│ ├── v1.yaml # Version 1 spec (for changelog diff)
│ └── v2.yaml # Version 2 spec (for changelog diff)
├── docs/
│ ├── QUICKSTART.md # Step-by-step getting started guide
│ └── how-the-generators-work.md # Technical deep-dive into the generators
└── tests/
└── test_changelog_gen.py # Tests for the changelog generator
Get the full API Documentation Toolkit and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.