Created
March 24, 2021 13:44
-
-
Save iskakaushik/a739ec04a2a200fb74d288f63f296a38 to your computer and use it in GitHub Desktop.
Notion Scripts for Personal CRM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Inner Circle | 7 | |
---|---|---|
Close Friend | 14 | |
Friend | 28 | |
Professional | 90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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