You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

read_top.py 609B

123456789101112131415161718192021
  1. from million.view.bar_chart import plot as bar_chart
  2. from million.analyze.count_participations import count_participations
  3. from million.analyze.retain_counts import retain_counts
  4. import million.parse.fb_exports as fb
  5. DATA_PATH = './data/'
  6. export = fb.parse_dirfiles(DATA_PATH)
  7. filtered = retain_counts(export.messages)
  8. print(len(filtered))
  9. counted_participations = count_participations(filtered, export.participants)
  10. kept_participations = [
  11. p for p in counted_participations if p['participations'] > 100]
  12. print("\n".join(
  13. [f"{p['name']}: {p['participations']}" for p in kept_participations]))