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 !”

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.

Source Distribution

dtc-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

dtc-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file dtc-0.1.1.tar.gz.

File metadata

  • Download URL: dtc-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a2 CPython/3.5.2 Linux/4.4.0-133-generic

File hashes

Hashes for dtc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9b8d7318ccc8e0ba1b1d0aaf8acb57fb2fe9f9e82e68334f25cd84d5ffe235c0
MD5 1027db3f845a82c1ee444f4bd323fb8e
BLAKE2b-256 4764950c05fd2b766db3217aec1f22b3453dbafe4ee389cf73c498bdccc3d4ae

See more details on using hashes here.

File details

Details for the file dtc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dtc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a2 CPython/3.5.2 Linux/4.4.0-133-generic

File hashes

Hashes for dtc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b5df7fe0eccf1e39053b3e030020a0ac5e19ad21be10e375eb72083bc5c5a12
MD5 fe385d52a48380956e22eaf8e803b126
BLAKE2b-256 2716dc2d61163cec7266e3de771243b701fd8cb4e362b8742af5d3fede9ed607

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