-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate_test_data.py
executable file
·79 lines (73 loc) · 2.68 KB
/
generate_test_data.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
79
#!/usr/bin/env python3
# ✓
from datetime import datetime
import calendar_tools
import serialize
TZ = calendar_tools.get_local_timezone()
def generate_test_data():
return {
"weather": {
"temp": 11.8,
"sunrise": datetime(2020, 11, 14, 7, 27, 1, tzinfo=TZ),
"sunset": datetime(2020, 11, 14, 16, 14, 52, tzinfo=TZ),
"status": "clear sky",
"forecast": [
{
"temp": 11.15,
"status": "scattered clouds",
"ts": datetime(2020, 11, 14, 19, 0, tzinfo=TZ),
},
{
"temp": 10.63,
"status": "clear sky",
"ts": datetime(2020, 11, 14, 22, 0, tzinfo=TZ),
},
{
"temp": 10.03,
"status": "snow",
"ts": datetime(2020, 11, 15, 1, 0, tzinfo=TZ),
},
{
"temp": 9.76,
"status": "overcast clouds",
"ts": datetime(2020, 11, 15, 4, 0, tzinfo=TZ),
},
],
},
"events": [
{
"ts": None,
"title": (
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
"Donec hendrerit tempor tellus. "
"Donec pretium posuere tellus. "
"Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. "
"Cum sociis natoque penatibus et magnis dis parturient montes, "
"nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. "
"Nullam tristique diam non turpis. "
"Cras placerat accumsan nulla. "
"Nullam rutrum. "
" Nam vestibulum accumsan nisl."
),
},
{"ts": None, "title": "Document E-Paper Calendar"},
{"ts": "18:00-19:00", "title": "Third"},
{"ts": "13:37-23:42", "title": "Second"},
{"ts": " 9:30-10:30", "title": "First"},
],
"weather_icons": {
"clear sky": r"\Sun",
"few clouds": r"\SunCloud",
"scattered clouds": r"\Cloud",
"overcast clouds": r"\Cloud",
"broken clouds": r"\Cloud",
"shower rain": r"\RainCloud",
"rain": r"\RainCloud",
"light rain": r"\WeakRainCloud",
"thunderstorm": r"\Lightning",
"snow": r"\Snow",
"mist": r"\Fog",
},
}
if __name__ == "__main__":
print(serialize.serialize(generate_test_data()))