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

Uploaded Source

Built Distribution

drftypegen-0.3.2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: drftypegen-0.3.2.tar.gz
  • Upload date:
  • Size: 8.1 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.3.2.tar.gz
Algorithm Hash digest
SHA256 c6a611375a84e89f7c812d7bc6d7a09656ac8754dd37abad681410baf758bc6b
MD5 9bd1a757533799f75ec3a1152e6dd04c
BLAKE2b-256 af03d30e689cb3848eda16d37c60964c717a4bad57736fb91e29d25992c03a7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drftypegen-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 13.8 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.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0ba7f67eeadd6899824c6226d1be2aeae977ac67d62af975ba8d0e435d3ae211
MD5 f537758fdf47ec03f60a673314857546
BLAKE2b-256 dfd65c1ae08182bfbc476dad0acaee76ebb3bd4cc7a47370abeb5fc8e9e86516

See more details on using hashes here.

Supported by

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