10 elif "Deezer" in service:
12 elif "Google Play" in service:
14 elif "- YouTube" in service
or "Youtube Ads Revenue" in service:
15 return "YouTube Content ID"
16 elif "YouTube - Subscription" in service:
17 return "YouTube Music"
18 elif "iTunes" in service:
20 elif "Amazon" in service:
22 elif "Spotify" in service:
24 elif "Tencent" in service:
26 elif "Tidal" in service:
28 elif "Alibaba" in service:
30 elif "Netease" in service:
32 elif "Pandora" in service:
34 elif "Yandex" in service:
36 elif "Facebook" in service:
38 elif "Audio tier" in service:
39 return "Youtube Audio Tier"
40 elif "Tik Tok" in service:
42 elif "Slacker" in service:
44 elif "Soundcloud" in service:
49 """Maps the sale type using the service, according to their requirements
51 service (str): service shown in the original file
52 Returns: (sale type in a single one letter)
54 if "Amazon" in service
or "Google Play" in service:
59 """Applies type functions to current dataframe
61 df (pandas dataframe): dataframe where changes will applied
62 Returns: df (pandas dataframe)
64 df[
'getservice'] = df.apply(
lambda Row: self.
serviceFinder(Row[
'music service']), axis=1)
65 df[
"gettypestate51"] = df.apply(
lambda Row: self.
type(Row[
'getservice']), axis=1)
70 """Sets date column given the filename (it contains the date)
71 For example 12822_detail_2021_12_14_982.csv
73 filename (str): current filename
74 Returns: date_str (str)
77 year = re.findall(
r'_\d{4}_', filename)[0]
78 month = re.findall(
r'_\d{2}_', filename)[0]
79 year = year.replace(
"_",
"")
80 month = month.replace(
"_",
"")
serviceFinder(self, service)