Transpile Python Data Models to Polyglot Schemas
transpile_model_bridgeGenerate TypeScript interfaces, Rust structs, or Go structs from Python @dataclass and Pydantic models deterministically via AST, enabling cross-language type schemas.
Instructions
Transpiles Python @dataclass and Pydantic data models into TypeScript interfaces, Rust structs, and Go structs deterministically via AST, distinguishing from 'prune_code_snippet' and 'generate_architecture_blueprint' by generating concrete cross-language type schemas rather than pruning code or diagramming topologies.
Parameters:
file_path(str, required): Path to the Python file containing @dataclass or Pydantic model definitions.target_lang(str, optional, default='ts'): Target programming language: 'ts' (TypeScript), 'rust' (Rust with serde), 'go' (Golang), or 'all' (all languages).
Behavior:
Mutability: Read-only static AST inspection; does not modify source files on disk.
Idempotency: Produces identical type definitions for identical source model input.
Performance & Latency: Completes model transpilation in <40ms; consumes <30MB RAM.
Privacy: 100% offline local AST parsing; zero external network calls.
Auth & Limits: Zero external credentials or API keys required; zero rate limits.
Error Handling: Gracefully reports missing file or syntax error without crashing.
Usage Guidelines:
When to use: Use when transpiling Python @dataclass and Pydantic models into TypeScript interfaces, Rust structs, or Go structs deterministically via AST.
When NOT to use: Do not use for generic Python to JavaScript logic compilation (use specialized external compilers instead); do not use for high-level Mermaid architecture diagrams (use 'generate_architecture_blueprint' instead).
Returns: Formatted Markdown report containing transpiled type definitions in the requested target language.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to Python file containing data models. | |
| target_lang | No | Target language: 'ts', 'rust', 'go', or 'all' (default: 'ts'). | ts |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |