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-py3-none-any.whl (6.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size dtc-0.1.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page