Enhanced dict for python 3
Project description
This library is a port to python 3 of the package ‘addicted’
Dict
Same as Dict from ‘mewwts/addict‘ except that update() method accept list,tuple and kwargs like usual python dict. The use of ‘inspect‘ module has been removed for performance reason.
AddDict
Dict with these additional methods :
pprint() find(pattern,**kwargs) count_some_values(pattern,ignore_case=False) count_some_keys(pattern,ignore_case=False) count_some_items(filter) iter_some_items(pattern,ignore_case=False) iter_some_values(pattern,ignore_case=False) iter_some_keys(pattern,ignore_case=False) get_some_items(pattern,ignore_case=False) get_some_values(pattern,ignore_case=False) get_some_keys(pattern,ignore_case=False) mget(*key_list) extract(key_list) parse_booleans(key_list) parse_numbers(key_list) update_dict(*args, **kwargs)
NoAttrDict
Works like AddDict, except that it returns a ‘NoAttr‘ value when an attribute is missing. Please read noattr package notes for explaination about ‘NoAttr‘
from addicted import Dict,NoAttrDict d1 = AddDict() d2 = NoAttrDict() print type(d1.a.b.c.d) >>> <class 'addicted.AddDict'> print type(d2.a.b.c.d) >>> <class 'noattr.NoAttrType'>
News
3.0.1 (2021-11-30)
Fix basestring -> str
3.0.0 (2018-11-07)
First version python 3
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
addicted3-3.0.1.tar.gz
(15.7 kB
view hashes)
Built Distribution
addicted3-3.0.1-py3-none-any.whl
(15.3 kB
view hashes)
Close
Hashes for addicted3-3.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 397d2053592ba042269aefc90a0722c206f955ebe19438ba99ef07f49670a1c3 |
|
MD5 | eda1105d59efb347037f43c4138da9aa |
|
BLAKE2b-256 | e3f03b9c2891f38c5b258fa493d32279920055a65cf0f925ab61418b3d9eb99c |