12345678910111213141516171819202122232425262728 |
- from million.view.bar_chart import plot as bar_chart
- from million.analyze.count_participations import count_participations
- from million.analyze.retain_counts import retain_counts
- import million.parse.fb_exports as fb
-
- DATA_PATH = './data/'
-
- export = fb.parse_dirfiles(DATA_PATH)
-
- filtered = retain_counts(export.messages)
-
- print(len(filtered))
-
- # split messages into months
- first = filtered[0].date.strftime("%Y-%m")
- last = filtered[-1].date.strftime("%Y-%m")
- months = {
- f"{year}-{month:02}": []
- for year in range(int(first[:4]), int(last[:4]) + 1)
- for month in range(1, 13)
- }
-
- for message in filtered:
- month = message.date.strftime("%Y-%m")
- months[month].append(message)
-
- for month, messages in months.items():
- print(f"{month}: {len(messages)}")
|