Skip to main content

An extended version of [addict](https://github.com/mewwts/addict).

Project description

python version PyPI version Downloads Status Downloads License pypi format Maintenance

entity_addict

An extended version of addict.

It can be very useful as a decorator. It can be converted to Dict when the function returns a value. Can support a single dictionary, list dictionary, or multi deep dictionary of list.

install via pip

pip install entiry_addict

examples:

from entity_addict import entity_addict
    
@entity_addict
def get_dict_data_a():
    return {"key_name": "value"}

data = get_dict_data_a()
print(data.key_name)

@entity_addict
def get_dict_data_b():
    return [{"key_name": "value"}]

for data in get_dict_data_b():
    print(data.key_name)

@entity_addict
def get_dict_data_c():
    return [
        {"key_name": "value"},
        {"key": [{"sub_key1": 1}, {"sub_key2": 2}]}
    ]
data = get_dict_data_c()
print(data[1].key[1].sub_key2)

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

entity_addict-1.2.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

entity_addict-1.2.1-py3-none-any.whl (4.3 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