Skip to main content

converts python dictoinary to class object

Project description

mclass: convert python dict to python class object

PyPI Latest Release

What is it?

mclass 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 mclass

Example

from mclass 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.4.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mclass-1.3.4.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.4.tar.gz
Algorithm Hash digest
SHA256 414f786287b80a80261125fc9ed844dbf9093907e96999a2f0391a7b32a1cb60
MD5 deb58131c14ccc6f33b409d641f50168
BLAKE2b-256 1ac1bcef375ab907942b67f81e80ed0df76e8cb19c155de3d52181ea17c3c707

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: mclass-1.3.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1382b4e93d2c1f6cbf88174643a7822e8877dab70f69cfd1044de7ea1f2fca52
MD5 d12dc016151cd71627239a2cd31a9e24
BLAKE2b-256 de55f0aa8725040bd019557bb6c6821310f4ae0183ff9c9db1981e98ef6b18e3

See more details on using hashes here.

Provenance

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