Simple Python script to convert a dict into a class instance
Project description
Object To Class
a simple python script to convert dict into a class instance
example
# import the package
from objecttoclass import ObjectToClass as OTC
# or : from objecttoclass import OTC (Variable holding the ObjectToClass instance )
# set the data you want to convert
data = {
"name":"Hussein Naim"
}
# new OTC instance
instance = OTC(data)
# print out the name attr
print(instance.name)
# output: Hussein Naim
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
objecttoclass-0.0.1.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for objecttoclass-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93851e5c8577b3baab70dbcae91cfa72e182f37533a7ce5a0af2b80625b78fda |
|
MD5 | 41d4afa88f9e23b20c873e208ecf678f |
|
BLAKE2b-256 | 215a7d5fd99d8aee13f890704be61ed12f37a6a038fdb08371c6a0b6edebb175 |