-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplex.py
More file actions
55 lines (50 loc) · 907 Bytes
/
Copy pathcomplex.py
File metadata and controls
55 lines (50 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from datetime import datetime
from deepdiff import DeepDiff
from rich import print
from deepdiff_viewer.rich import RichViewer
t1 = {
"int": 1,
"change type": 42,
"set": {
"hello",
"there",
},
"list": [1, 2, 3, 4],
"multiline": """hello
there
!
""",
"dict": {
"a": 42,
"b": 51,
"c": {"x": 1, "y": 2},
},
"removed_dict": {
"a": 21,
"b": {"x": 1},
},
"date": datetime(2005, 12, 15, 9, 55, 0),
}
t2 = {
"int": 2,
"change type": "42",
"set": {
"world",
},
"list": [2, 3, 4, 5],
"multiline": """hello
world
""",
"dict": {
"a": 21,
"c": {"x": 1},
},
"new_dict": {
"a": 21,
"b": {"x": 1},
},
"date": datetime(2000, 12, 12, 14, 55, 0),
}
ddiff = DeepDiff(t1, t2, view="tree")
viewer = RichViewer(ddiff)
print(viewer.render())