SDK Generation
Command
<module::attr>— Python import path to yourDjsonApiinstance (e.g.,articles.views::api)--output— output directory for the generated SDK package--language—python(default) ortypescript
Requirements
djsonapimust be inINSTALLED_APPS- Run from your Django project directory
Examples
Output structure
What's generated
For each resource type in your API, the generator produces:
- Typed class with attribute annotations, relationship types, and capabilities baked in
- CRUD methods — only those with registered endpoints
- Query methods — typed filter/sort/page based on handler parameters
- Relationship methods —
add/remove/reset/editonly when the corresponding endpoints exist - Type conversions — annotated types drive runtime conversion (JSON string →
Python
datetime, etc.)
Capability gating
The generated SDK reflects exactly what your server supports:
- No
delete()if you didn't register@api.delete_one - No
create()if you didn't register@api.create_one - No relationship mutations if the endpoints don't exist
sdk.unknown_type→AttributeError(instead of making up URLs)
This is enforced at the class level — capabilities are frozenset members,
checked at import time in Python and at class definition in TypeScript.