No project description provided
Project description
print-dict
Install
$ pip install -U print-dict
Usage
from print_dict import pd pd({'key': 'value'}) # Or from print_dict import print_dict print_dict({'key': 'value'})
Example 1
Code:
from print_dict import pd dict1 = { 'key': 'value' } pd(dict1)
Output:
{
'key': 'value'
}
Example 2
Code:
from print_dict import pd class Object1: pass class Object2: def __repr__(self): return "<Object2 info>" def custom_method(): pass object1 = Object1() data = { "one": "value-one", "two": "value-two", "three": "value-three", "four": { '1': '1', '2': '2', '3': [1, 2, 3, 4, 5], '4': { 'method': custom_method, 'tuple': (1, 2), 'unicode': u'\u2713', 'ten': 'value-ten', 'eleven': 'value-eleven', '3': [1, 2, 3, 4] } }, "object1": object1, "object2": Object2(), "class": Object1 } pd(data)
Output:
{
'one': 'value-one',
'two': 'value-two',
'three': 'value-three',
'four': {
'1': '1',
'2': '2',
'3': [1, 2, 3, 4, 5],
'4': {
'method': <function custom_method at 0x7ff6ecd03e18>,
'tuple': (1, 2),
'unicode': '✓',
'ten': 'value-ten',
'eleven': 'value-eleven',
'3': [1, 2, 3, 4]
}
},
'object1': <__main__.Object1 object at 0x7ff6ecc588d0>,
'object2': <Object2 info>,
'class': <class '__main__.Object1'>
}
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size print_dict-0.1.13-py3-none-any.whl (8.0 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size print-dict-0.1.13.tar.gz (7.9 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for print_dict-0.1.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c2ef7ab07a9dc2e1f9e9b37830e803bc7c4bedbed8af0fb58363e3e007608a0 |
|
MD5 | 01db367514147576525e2b87c53aa8b4 |
|
BLAKE2-256 | 8b3d32d08d7fd8de50ebd7ea852e2d584e07a8f9c22a570199057769faf4e29f |