AI-powered Django API documentation & SDK generator with client libraries for Python, TypeScript, and interactive documentation
Project description
Easy SDK - Django API Documentation & SDK Generator
๐ AI-powered tool that generates comprehensive API documentation and client SDKs for Django REST Framework projects.
โจ What Easy SDK Does
Easy SDK transforms your Django REST Framework projects into:
- ๐ Interactive Documentation - Beautiful Swagger-like docs with live API testing
- ๐ Python SDKs - Complete async client libraries with type hints and Pydantic models
- ๐ท TypeScript SDKs - Full-featured clients with comprehensive type definitions
- ๐ค AI-Enhanced - Smart structure analysis and code generation using OpenAI/Anthropic
๐ Quick Start
Installation
pip install easy-sdk
Generate Everything
# Generate interactive docs + Python & TypeScript SDKs
easy-sdk /path/to/django/project generate-sdk --language python --language typescript
# Or generate just documentation
easy-sdk /path/to/django/project --format docusaurus
๐ Documentation Generation
Docusaurus (Interactive Documentation)
Generate beautiful, interactive API documentation with live testing capabilities:
# Generate Docusaurus documentation
easy-sdk /path/to/project --format docusaurus
# The generated docs include:
# - Interactive Swagger-like API explorer
# - Live API testing in the browser
# - Auto-generated request/response examples
# - Beautiful, responsive UI
Features:
- ๐งช Interactive Testing - Test APIs directly in the browser
- ๐ Schema Visualization - Expandable object schemas
- ๐จ Modern UI - Clean, Swagger-style interface
- ๐ง Auto-deployment - Works with any existing Docusaurus project
Sphinx (Traditional Documentation)
# Generate traditional Sphinx documentation
easy-sdk /path/to/project --format sphinx
๐ SDK Generation
Easy SDK generates production-ready client libraries for multiple programming languages.
Python SDKs
easy-sdk /path/to/project generate-sdk --language python --library-name "my_api_client"
Generated Python SDK features:
- โ Async/await support - Modern asynchronous HTTP client
- โ Type hints - Full type safety with Pydantic models
- โ Error handling - Comprehensive exception hierarchy
- โ Auto-retry - Exponential backoff for failed requests
- โ Authentication - Token, Bearer, JWT support
- โ Validation - Request/response validation with Pydantic
Example usage:
import asyncio
from my_api_client import MyApiClient
async def main():
async with MyApiClient(api_key="your-key") as client:
# List users
users = await client.users.list_users()
# Create user
user = await client.users.create_user({
"name": "John Doe",
"email": "john@example.com"
})
# Get user details
user_details = await client.users.get_user(user["id"])
asyncio.run(main())
TypeScript SDKs
easy-sdk /path/to/project generate-sdk --language typescript --library-name "my-api-client"
Generated TypeScript SDK features:
- โ Full type definitions - Complete TypeScript interfaces
- โ Modern async/await - Promise-based API
- โ Browser + Node.js - Universal compatibility
- โ Tree-shakable - ESM and CommonJS support
- โ Auto-retry - Built-in retry logic with backoff
- โ Type-safe - Compile-time API validation
Example usage:
import { MyApiClient } from 'my-api-client';
const client = new MyApiClient({
apiKey: 'your-key',
baseUrl: 'https://api.example.com'
});
// Fully typed responses
const users: User[] = await client.users.listUsers();
// Type-safe requests
const newUser: User = await client.users.createUser({
name: 'John Doe',
email: 'john@example.com'
});
Multi-Language Generation
# Generate both Python and TypeScript SDKs
easy-sdk /path/to/project generate-sdk \
--language python \
--language typescript \
--library-name "awesome_api"
๐ค AI-Powered Features
Easy SDK uses AI to intelligently analyze your Django project and generate optimal code structures.
Setup AI Integration
# OpenAI (GPT-4, GPT-3.5)
export OPENAI_API_KEY=sk-your-openai-key
# Anthropic (Claude)
export ANTHROPIC_API_KEY=sk-ant-your-key
# Use AI for enhanced generation
easy-sdk /path/to/project generate-sdk \
--language python \
--ai-provider openai \
--ai-model gpt-4
AI enhancements include:
- ๐ Smart API Analysis - Identifies patterns and optimal SDK structure
- ๐ Architecture Recommendations - Suggests best practices for client organization
- ๐ Error Pattern Detection - Improves error handling based on API patterns
- ๐ Enhanced Documentation - Generates better descriptions and examples
๐ Commands Reference
Main Commands
# Generate documentation
easy-sdk /path/to/project [OPTIONS]
# Generate client SDKs
easy-sdk /path/to/project generate-sdk [OPTIONS]
# List supported SDK languages
easy-sdk list-sdk-languages
# Analyze project structure
easy-sdk /path/to/project analyze
# Validate Django project
easy-sdk /path/to/project validate
SDK Generation Options
--language, -l SDK language(s): python, typescript, js, ts
--library-name Custom library name
--output-dir, -o Output directory
--preview-only Preview structure without generating
--ai-provider AI provider: openai, anthropic, local
--ai-model AI model (e.g., gpt-4, claude-3)
--apps, -a Include specific Django apps
--verbose, -v Enable verbose logging
Documentation Options
--format, -f Format: sphinx, docusaurus
--output-dir, -o Output directory
--docusaurus-only Generate only Docusaurus docs
--sphinx-only Generate only Sphinx docs
--apps, -a Include specific Django apps
--ai-provider AI provider for enhanced docs
๐ Generated Structure
SDK Output Structure
Python SDK:
sdk_python/
โโโ setup.py # Package setup
โโโ requirements.txt # Dependencies
โโโ my_api_client/
โ โโโ __init__.py # Main exports
โ โโโ client.py # Main SDK client
โ โโโ base_client.py # HTTP client base
โ โโโ exceptions.py # Error handling
โ โโโ models/ # Pydantic models
โ โ โโโ __init__.py
โ โ โโโ user.py
โ โ โโโ product.py
โ โโโ clients/ # App-specific clients
โ โโโ users_client.py
โ โโโ products_client.py
TypeScript SDK:
sdk_typescript/
โโโ package.json # Package configuration
โโโ tsconfig.json # TypeScript config
โโโ src/
โ โโโ index.ts # Main exports
โ โโโ BaseClient.ts # HTTP client
โ โโโ exceptions.ts # Error classes
โ โโโ types/ # Type definitions
โ โ โโโ index.ts
โ โ โโโ common.ts
โ โ โโโ users.ts
โ โ โโโ products.ts
โ โโโ clients/ # API clients
โ โโโ UsersClient.ts
โ โโโ ProductsClient.ts
Documentation Structure
Docusaurus:
docusaurus/
โโโ docs/
โ โโโ intro.md
โ โโโ api/
โ โโโ users/
โ โ โโโ index.md # Interactive API explorer
โ โ โโโ endpoints.md # Detailed endpoints
โ โโโ products/
โโโ src/
โ โโโ components/ # React components
โ โโโ ApiExplorer/ # Interactive API testing
โ โโโ SwaggerApiDocs/ # Swagger-like UI
โโโ docusaurus.config.js
โโโ package.json
โ๏ธ Configuration
Create .easy-sdk.toml in your project root:
[project]
name = "My API"
version = "1.0.0"
[generation]
documentation_format = "docusaurus" # or "sphinx"
language_template = "typescript"
generate_multiple_languages = true
additional_languages = ["python"]
[output]
base_output_dir = "./generated"
sphinx_output_dir = "./docs"
[ai]
provider = "openai" # or "anthropic"
model = "gpt-4"
temperature = 0.1
[apps]
include_apps = ["users", "products", "orders"]
exclude_apps = ["admin", "internal"]
๐ฏ Real-World Examples
E-commerce API
# Generate complete SDK suite for e-commerce API
easy-sdk /path/to/ecommerce generate-sdk \
--language python \
--language typescript \
--library-name "ecommerce-sdk" \
--ai-provider openai
SaaS Platform API
# Generate interactive docs + Python SDK
easy-sdk /path/to/saas-api generate-sdk \
--language python \
--library-name "saas_client" \
--apps users subscriptions billing \
--format docusaurus
๐ง Advanced Features
Preview Mode
# Preview SDK structure without generating files
easy-sdk /path/to/project generate-sdk --preview-only --language python
Custom Templates
# Use custom naming conventions
easy-sdk /path/to/project generate-sdk \
--language typescript \
--interface-naming PascalCase \
--property-naming camelCase
Selective Generation
# Generate only specific Django apps
easy-sdk /path/to/project generate-sdk \
--language python \
--apps users products \
--exclude-apps admin
๐ฆ Requirements
- Python 3.8+
- Django 3.2+
- Django REST Framework 3.12+
Optional Dependencies
# For AI features
pip install easy-sdk[ai]
# For development
pip install easy-sdk[dev]
๐ Supported Languages
| Language | Status | Features |
|---|---|---|
| Python | โ Full | Async, Type Hints, Pydantic |
| TypeScript | โ Full | Full Types, ESM/CommonJS |
| JavaScript | โ Full | Same as TypeScript |
๐ค Contributing
git clone https://github.com/your-org/easy-sdk.git
cd easy-sdk
pip install -e .[dev]
pytest
๐ License
MIT License - see LICENSE file.
๐โโ๏ธ Support
- Issues: GitHub Issues
- Documentation: Full Documentation
- Examples: See
sample_projects/directory
Made with โค๏ธ for Django developers who want to ship great APIs faster.
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 easy_sdk-1.0.0.tar.gz.
File metadata
- Download URL: easy_sdk-1.0.0.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d38b7acf0d4e507ac625c4cd6e269e3178e3986bfcb7a07783b874030bf00042
|
|
| MD5 |
3872bce54244cad47ff1bee31ef480d4
|
|
| BLAKE2b-256 |
e6e89530ce28f13fd709fb18023353c108cdf9bbb28c59693d9dfdf72d78ed48
|
File details
Details for the file easy_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: easy_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c87edf9a7f11b71d0f50c73ca68a30ac64ed50d9ee66c89d72fc5034fed6b4d
|
|
| MD5 |
45f0afe2239bd88f237dcc0afa6b3709
|
|
| BLAKE2b-256 |
ac92d1e90181fc0d6748c8780cfb256f3cab06c62775647c606a63723884908d
|