Skip to content

Instantly share code, notes, and snippets.

@iskakaushik
Created March 24, 2021 13:44
Show Gist options
  • Save iskakaushik/a739ec04a2a200fb74d288f63f296a38 to your computer and use it in GitHub Desktop.
Save iskakaushik/a739ec04a2a200fb74d288f63f296a38 to your computer and use it in GitHub Desktop.
Notion Scripts for Personal CRM
Inner Circle 7
Close Friend 14
Friend 28
Professional 90
ASP = 'prop("Associations")'
def days_gt(days):
dgt = 'dateBetween(now(), prop("Last Contacted"), "days") > ' + days
res = 'if(%s, "😓", "💯")' % (dgt)
return res
f = open('assoc_list.csv', 'r')
ls = f.readlines()
x = []
for l in ls:
a, b = l.split(',')
a = a.strip()
b = b.strip()
x.append((a, b))
nl = 0
res = []
for y in x:
a, b = y
res.append('if(%s == "%s", ' % (ASP, a))
res.append(days_gt(b))
res.append(', ')
nl += 1
res.append('"Invalid Association!"')
for i in range(nl):
res.append(')')
print(''.join(res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment