Skip to main content

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


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)

Uploaded Source

Built Distribution

objecttoclass-0.0.1-py3-none-any.whl (1.9 kB view hashes)

Uploaded Python 3

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