A set of common tools.
Project description
Gadget
A wide variety of tools in the software development.
1 Gadget Abstract List
1.1 dict2class
Convert a parameter from "dict" type to simple User-defined class type.
Such as:
# Import required packages
from gadget import Dict2Class
import datetime
# Defines a dictionary
test_dict = {
'now': datetime.datetime.now(),
'num': 77,
'txt': 'Hello!',
'dct': {
't_num': 667,
't_txt': 'hello!'
},
'lst': [1, 2, 3, 'abc'],
'set': {1, 3, 3, 4, 'abc'},
'tpl': (1, 2, 3, 5, 'abc')
}
# Converts to user-defined class here
ud_class = Dict2Class().convert(test_dict)
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
gadgetpie-0.0.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for gadgetpie-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48e95f2f4fcbc0556f8ee57f1645cea6d87d6b79335616144df49492654fffba |
|
MD5 | 41fb95f28ca1370a0a7e19e3ac0e0b8c |
|
BLAKE2b-256 | 6104606e0aa594066963f5e093bbc7beec4fad8fa6b547d2fde1d702d84bac15 |