An django app to generate type information for rest_framework.
Project description
DRFTypeGen
DRFTypeGen is a app to enable user to generate type information for various languages.
Why?
Nowadays we use statically-typed languages in many consumer apps for our APIs. Of course there are 'schemas' to describe your API but generating types are better. This will enable projects to generate relevant type file(s) for using in other projects.
Installation
-
Install from pip:
pip install drftypgen
-
Add
drftypegen
in yourINSTALLED_APP
.
Usage
TypeScript
from drftypgen.compilers import TypeScriptCompiler
tscompiler = TypeScriptCompiler()
types_data = tscompiler.generate()
Now you can save the types_data
in file or serve in a view.
Or, you can generate TypeScript File with this management command with optional filename with --file
option:
./manage.py genTSTypes
TODO
Support for Wagtail- Support for Dart
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
drftypegen-0.1.8.tar.gz
(7.3 kB
view hashes)
Built Distribution
drftypegen-0.1.8-py3-none-any.whl
(13.1 kB
view hashes)
Close
Hashes for drftypegen-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6678bcca8949ddd2322567a8d4e5be349db9272fd2b22a657196b5329ce091bb |
|
MD5 | 235b127f2af7a4ea2941c26bcd5f53a5 |
|
BLAKE2b-256 | 188acdca5fa0f3f9873e91e7d5ae6b4c95bf1dd4abee3a22413228809cdf0eab |