Skip to main content

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

  1. Install from pip:

    pip install drftypgen
    
  2. Add drftypegen in your INSTALLED_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

  1. Support for Wagtail
  2. Support for Dart

Project details


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.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drftypegen-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file drftypegen-0.1.0.tar.gz.

File metadata

  • Download URL: drftypegen-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for drftypegen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59b317c91c3ba6d85485e66683c67cf8bb9f2658f42c6a7081ea842d0197bd01
MD5 2fb68e2b82f94332b130d7e1e8de601b
BLAKE2b-256 12cf8643bf1219cfeb8dec6b8712d0527c6577e45d4cf7472a241c13c86236bc

See more details on using hashes here.

File details

Details for the file drftypegen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: drftypegen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for drftypegen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48bba3db6e54ec578d150f34a4c4a1fbaeb46d2e0c70da64a5190bfe4d946c4b
MD5 fe97b7bf3a3175ca3327494459704f51
BLAKE2b-256 99780d3533657df8f9e9d81a389640e832a0ab8a2678cfea9d92dfac22f24b3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page