Skip to main content

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

Release files for mclass 1.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mclass 1.3.4
File Size Uploaded
mclass-1.3.4.tar.gz 2.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mclass 1.3.4
File Interpreter ABI Platform
mclass-1.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 4.7 kB

Release files / mclass-1.3.4.tar.gz

Download URL mclass-1.3.4.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
414f786287b80a80261125fc9ed844dbf9093907e96999a2f0391a7b32a1cb60
BLAKE2b-256 checksum
How to use checksums
1ac1bcef375ab907942b67f81e80ed0df76e8cb19c155de3d52181ea17c3c707
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / mclass-1.3.4-py3-none-any.whl

Download URL mclass-1.3.4-py3-none-any.whl
Size 2.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1382b4e93d2c1f6cbf88174643a7822e8877dab70f69cfd1044de7ea1f2fca52
BLAKE2b-256 checksum
How to use checksums
de55f0aa8725040bd019557bb6c6821310f4ae0183ff9c9db1981e98ef6b18e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

1.3.4 This release

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page