Skip to main content

converts python dictoinary to class object

Project description

diclass: convert python dict to python class object

PyPI Latest Release

What is it?

diclass It fully converts a python dict to a python class object and all dict keys and internal dict are converted to python class objects as well.

# !pip install diclass

Example

from diclass import DictClass
import pandas as pd
import numpy as np
obj = DictClass({'id':1, 'data':{'name':'John', 'age':31, 'wife':{'name':'Jessica', 'age':np.nan}}})

print(obj.id, obj.data.name, obj.data.wife.name)
1 John Jessica
obj
{'id': 1, 'data': {'name': 'John', 'age': 31, 'wife': {'name': 'Jessica', 'age': nan}}}

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

mclass-1.3.3.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

mclass-1.3.3-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file mclass-1.3.3.tar.gz.

File metadata

  • Download URL: mclass-1.3.3.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for mclass-1.3.3.tar.gz
Algorithm Hash digest
SHA256 84338d9fcbba32e93cc9ba88922eeefeb57c22575df19d27f75c0d1c17a4ae14
MD5 941da2c3382ffc9cc4092e842428b072
BLAKE2b-256 87f7e6c2263fca3b1b4c203c919c15e6d4d74aa1bbdec7dee496d3cd61b90bd8

See more details on using hashes here.

File details

Details for the file mclass-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: mclass-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for mclass-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 be263f4c57e39abbcb0f41617450ad4c65ce1f1dfa8d50a3b7da425c03c8a32c
MD5 17bd91f0dc01122587dffef374195a91
BLAKE2b-256 ae9360eb728fedca54e0747f9e4cd39df3aa7ce7b1b52d6086641930219c24bb

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