-
Notifications
You must be signed in to change notification settings - Fork 0
/
extendedExample.py
99 lines (81 loc) · 2.52 KB
/
extendedExample.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from typing import Mapping, Union
from src.extendedAnalyzer import ExtendedAnalyzer
def main() -> None:
payload: Mapping[str, Union[int, str]]
analyzer = ExtendedAnalyzer(["./data/personal/extendedData"])
print("Example 1: getPopularArtists()")
pa = analyzer.getPopularArtists()
print(pa)
print()
print("Example 1a: getPopularArtists() with specific Daytime")
payload = {"daytime": "morning"}
pa = analyzer.getPopularArtists(payload=payload)
print(pa)
print()
print("Example 1b: getPopularArtists() of Month July")
payload = {"month": 7}
pa = analyzer.getPopularArtists(payload=payload)
print(pa)
print()
print("Example 1c: getPopularPodcast() of Month July")
payload = {"month": 7}
pa = analyzer.getPopularPodcast(payload=payload)
print(pa)
print()
print(
"Example 1d: getPopularArtists() of specified period (2019-03-03 to 2019-03-04) for music, count = 3"
)
payload = {
"startYear": 2019,
"startMonth": 3,
"startDay": 3,
"startHour": 0,
"endYear": 2019,
"endMonth": 3,
"endDay": 4,
"endHour": 0,
"count": 3,
"media": "music",
}
pa = analyzer.getPopularArtists(payload=payload)
print(pa)
print()
print("Example 1e: getPopularArtists() for specific weekday (monday)")
payload = {
"weekday": "monday",
}
pa = analyzer.getPopularArtists(payload=payload)
print(pa)
print()
print("Example 2: getPopularItems()")
pi = analyzer.getPopularItems()
print(pi)
print()
print("Example 2a: getPopularPodcastItems() ")
pi = analyzer.getPopularPodcastItems()
print(pi)
print()
print("Example 2b: getPopularPodcastItems() for podcasts by time played in ms")
payload = {
"ratingCrit": "time",
}
pi = analyzer.getPopularPodcastItems(payload=payload)
print(pi)
print()
print("Example 2c: getPopularItems() with keyword 'franz ferdinand'")
pi = analyzer.getPopularItems(payload={"keyword": "Franz Ferdinand"})
print(pi)
print()
print("Example 2c2: getPopularItems() with keyword 'acoustic'")
pi = analyzer.getPopularItems(payload={"keyword": "acoustic"})
print(pi)
print()
print("Example 3: getDataPerWeekday()")
dpw = analyzer.getDataPerWeekday()
print(dpw)
print()
print("Example 3a: getDataPerWeekday() with string as key")
dpw = analyzer.getDataPerWeekday(weekdayFormat="")
print(dpw)
if __name__ == "__main__":
main()