Files
soleprint/soleprint/station/tools/modelgen/generator/__init__.py
2026-08-10 05:36:32 -03:00

55 lines
1.6 KiB
Python

"""
Generator - Stack-specific code generators for modelgen.
Supported generators:
- PydanticGenerator: Pydantic BaseModel classes
- DjangoGenerator: Django ORM models
- TypeScriptGenerator: TypeScript interfaces
- ProtobufGenerator: Protocol Buffer definitions
- PrismaGenerator: Prisma schema
- StrawberryGenerator: Strawberry type/input/enum classes
- DatagenGenerator: BaseDataGenerator subclass for station's datagen tool
"""
from typing import Dict, Type
from .base import BaseGenerator
from .datagen import DatagenGenerator
from .django import DjangoGenerator
from .jsonschema import JsonSchemaGenerator
from .prisma import PrismaGenerator
from .protobuf import ProtobufGenerator
from .pydantic import PydanticGenerator
from .sqlmodel import SQLModelGenerator
from .strawberry import StrawberryGenerator
from .typescript import TypeScriptGenerator
# Registry of available generators
GENERATORS: Dict[str, Type[BaseGenerator]] = {
"pydantic": PydanticGenerator,
"django": DjangoGenerator,
"sqlmodel": SQLModelGenerator,
"typescript": TypeScriptGenerator,
"ts": TypeScriptGenerator, # Alias
"protobuf": ProtobufGenerator,
"proto": ProtobufGenerator, # Alias
"prisma": PrismaGenerator,
"strawberry": StrawberryGenerator,
"schema": JsonSchemaGenerator,
"jsonschema": JsonSchemaGenerator, # Alias
"datagen": DatagenGenerator,
}
__all__ = [
"BaseGenerator",
"DatagenGenerator",
"PydanticGenerator",
"DjangoGenerator",
"StrawberryGenerator",
"TypeScriptGenerator",
"ProtobufGenerator",
"PrismaGenerator",
"JsonSchemaGenerator",
"GENERATORS",
]