Skip to main content

Generate Dataclass without writting them !

Project description

https://travis-ci.org/jgirardet/dtc.svg?branch=master https://ci.appveyor.com/api/projects/status/ffd44ndqx713yuhd/branch/master?svg=true

DTC :”Generate Dataclasses without writting them !”

Warning

This is an alpha version

Basic Usage

>>> import dtc

>>> JSON = b"""{"flooat": 12.564, "boolean": true, "integer": 12}"""

>>> my_class = dtc.from_json(JSON)

>>> my_class
Base(flooat=12.564, boolean=True, integer=12)

>>> from dataclasses import *
>>> is_dataclass(my_class)
True

>>> JSON = b"""[{"flooat": 12.4, "boolean": true, "integer": 1}, {"flooat": 12.564, "boolean": true, "integer": 12},{"flooat": 1.4, "boolean": false, "integer": 0}]"""
>>> dtc.from_json(JSON
    [Base(flooat=12.4, boolean=True, integer=1), Base(flooat=12.564, boolean=True, integer=12), Base(flooat=1.4, boolean=False, integer=0)]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dtc, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size dtc-0.1.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View
Filename, size dtc-0.1.1-py3-none-any.whl (6.5 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page