Skip to main content

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.

Version Python Django License

โœจ 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


Made with โค๏ธ for Django developers who want to ship great APIs faster.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_sdk-1.0.0.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_sdk-1.0.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

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

Hashes for easy_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d38b7acf0d4e507ac625c4cd6e269e3178e3986bfcb7a07783b874030bf00042
MD5 3872bce54244cad47ff1bee31ef480d4
BLAKE2b-256 e6e89530ce28f13fd709fb18023353c108cdf9bbb28c59693d9dfdf72d78ed48

See more details on using hashes here.

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

Hashes for easy_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c87edf9a7f11b71d0f50c73ca68a30ac64ed50d9ee66c89d72fc5034fed6b4d
MD5 45f0afe2239bd88f237dcc0afa6b3709
BLAKE2b-256 ac92d1e90181fc0d6748c8780cfb256f3cab06c62775647c606a63723884908d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page