--- id: django-typomatic version: "2.5.2" license: unclear license_treatment: unclear maintenance: aging --- # django-typomatic — A simple solution for generating Typescript interfaces from your Django Rest Framework Serializers. License: unclear · Maintenance: aging · Downloads: 225.9K/mo ## What it is and what it does django-typomatic is a code generator that reads Django Rest Framework serializers and outputs TypeScript interface definitions, eliminating manual type duplication between Python APIs and TypeScript frontends. It supports nested serializers, list fields, choice fields with optional enum generation, and field name camelization. The package offers two workflows: a decorator-based approach where you mark serializers with @ts_interface() and call generate_ts() to write files, or a CLI mode that scans your project for serializers without requiring decorators or manual function calls. The tool bridges the impedance mismatch between Python's dynamic typing and TypeScript's static types by introspecting field definitions and mapping them to TypeScript equivalents. It handles patterns like many=True for arrays, nested object types, and choice constraints. Contexts allow you to partition serializers into separate output files, and the camelize option converts snake_case field names to camelCase for JavaScript conventions. Use it for: - Generate TypeScript types automatically when your Django API serializers change, keeping frontend type definitions in sync without manual editing. - Create separate TypeScript interface files for internal and external API versions using context-based filtering. - Export choice fields as TypeScript enums to enforce type-safe selection of predefined values in the frontend. - Reduce boilerplate by generating nested interface hierarchies that mirror your serializer structure. - Integrate into a build pipeline to regenerate TypeScript definitions on each API deployment. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates TypeScript interfaces and enums from Django Rest Framework serializers, automating type definition creation for frontend-backend API contracts. Yes, with conditions. Install if you have a Django Rest Framework API and a TypeScript frontend, want to eliminate manual type synchronization, and are willing to verify the license status before production use. The low install friction and active repository make it reasonable, but the aging maintenance status means you should confirm it handles your serializer patterns before committing to it as a core build tool. ## Install pip install django-typomatic uv add django-typomatic poetry add django-typomatic ## Installing django-typomatic Before you install: Low friction install with only django and djangorestframework as dependencies. Maintenance status is aging—last release was in 2024-07-02, though the repository remains active with a recent commit on 2025-04-27 and is not archived. License in practice: License status is unclear; no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before adopting in proprietary or restricted-license projects. Quickstart: pip install django-typomatic from django_typomatic import ts_interface, generate_ts @ts_interface() class MySerializer: name = None generate_ts('./output.ts') Requires django and djangorestframework to be installed; to use the CLI, django_typomatic must be added to INSTALLED_APPS. Verify before relying: - Python version compatibility not specified in metadata; verify support for your target Python version. - Actual license terms unknown; check repository for LICENSE file or clarification before use in commercial projects. - Whether the package handles all serializer field types your project uses. ## Package facts - License: not declared (unclear) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 225.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags typescript interface generation django, drf serializer to typescript, django rest framework type definitions, python to typescript types, api schema typescript export, code-generation, type-safety, api-contracts [View on SkillFed](https://skillfed.io/packages/django-typomatic) · [View on PyPI](https://pypi.org/project/django-typomatic/)