-
Notifications
You must be signed in to change notification settings - Fork 5
/
tests_syntax.py
78 lines (70 loc) · 1.64 KB
/
tests_syntax.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from path_dict import PathDict as pd
users ={
"user_1": {
"name": "John Smith",
"email": "[email protected]",
"age": 32,
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
},
"interests": ["reading", "hiking", "traveling"]
},
"user_2": {
"name": "Jane Doe",
"email": "[email protected]",
"age": 28,
"address": {
"street": "456 Oak Ave",
"city": "Somewhere",
"state": "NY",
"zip": "67890"
},
"interests": ["cooking", "running", "music"],
"job": {
"title": "Software Engineer",
"company": "Example Inc.",
"salary": 80000
}
},
"user_3": {
"name": "Bob Johnson",
"email": "[email protected]",
"age": 40,
"address": {
"street": "789 Maple Blvd",
"city": "Nowhere",
"state": "TX",
"zip": "54321"
},
"interests": ["gardening", "fishing", "crafts"],
"job": {
"title": "Marketing Manager",
"company": "Acme Corporation",
"salary": 90000
}
},
"user_4": {
"name": "Alice Brown",
"email": "[email protected]",
"age": 25,
"address": {
"street": "321 Pine St",
"city": "Anywhere",
"state": "FL",
"zip": "13579"
},
"interests": ["painting", "yoga", "volunteering"],
"job": {
"title": "Graphic Designer",
"company": "Design Co.",
"salary": 65000
}
}
}
users_pd = pd(users)
users_pd.at("user_4")
print(users_pd.at("user_5").set({"name": "John Smither", "age": 33}))
# print(users_pd.at("*", "age").gather(as_type="list", include_paths=True))