Skip to main content

Awesome module for conver dict to class

Project description

About this project:

  • This project created to convert any dict into class in python :) check github

Install:

  • pip install python-dtoc

Simple example:

  • Print the object :

from pydtoc import dtc

foo = dtc({'str': 'string', 'int': 1, 'list': [1, 2, 3, 4, {'hi': True}]})

print(foo)
  • Output :
{

    "str": "string",

    "int": 1,

    "list": [

        1,

        2,

        3,

        4,

        {

            "hi": true

        }

    ]

}
  • Print key of value :

from pydtoc import dtc

foo = dtc({'str': 'string', 'int': 1, 'list': [1, 2, 3, 4, {'hi': True}]})

print(foo.list[-1].hi)

print(foo.str)
  • Output :

True

string

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

python-dtoc-2023.10.5.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

python_dtoc-2023.10.5-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file python-dtoc-2023.10.5.tar.gz.

File metadata

  • Download URL: python-dtoc-2023.10.5.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for python-dtoc-2023.10.5.tar.gz
Algorithm Hash digest
SHA256 eabcb3a8724044aec099533f0b4772c84ba97e34d2504d341843d1ba2a2af845
MD5 1648d67963ab16933f7b80aa57664c69
BLAKE2b-256 506e76a833e6f585d0b7e9878283f229c4e71df1768d4e728ece033420caac85

See more details on using hashes here.

File details

Details for the file python_dtoc-2023.10.5-py3-none-any.whl.

File metadata

File hashes

Hashes for python_dtoc-2023.10.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3a5334ce0d16cc43f4d5e0419b9b22a5226a632884378f87f7d0118057adc287
MD5 c2da993bdfa6c7fbfd5743ea8b35d81a
BLAKE2b-256 e22a5fb867fbe868e5d58f00d916554011a9a4043b37ff87bc291b55d3309511

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