diff --git a/demand.py b/demand.py new file mode 100644 index 0000000..2e0be9a --- /dev/null +++ b/demand.py @@ -0,0 +1,102 @@ +import random + +""" +def ___________(): +My name is [Name], and I am reaching out to demand that the Mayor and City Council redirect money away from the police department and invest into community resources. + +def ___________(): +It has been proven time and time again that police brutality is a systemic issue and has racially targeted Black and Brown people for hundreds of years. + + +""" +def gen_message(name): + return f"\t{gen_thesis(name)} {gen_elaborate()} {gen_more()}\n\n\t{gen_redirect()}\n\n\t{gen_final()}" + +def gen_thesis(name): + n = [ "My name is", "I'm" ] + contact = ["getting in touch", "reaching out", "contacting you", "sending you this message"] + verb = ["demand for", "ask for", "request for"] + money = ["funds", "public funds", "taxpayer money"] + scale = ["community", "local"] + service = ["programs", "services", "resources"] + + return f'{random.choice(n)} {name} and I am {random.choice(contact)} to {random.choice(verb)} the redirection of {random.choice(money)} away from the police department and into other {random.choice(scale)} {random.choice(service)}.' + +def gen_elaborate(): + h = ["It has been proven time and time again", "History has shown", "Recent events have shown"] + adjective = ["an institutional", "a systemic"] + noun = ["issue", "problem"] + adverb = ["disproportionately", "unfairly", "unevenly", "unequally"] + verb = ["targets", "affects", "victimizes", "preys upon"] + p = ["Black and Brown people", "the African-American and Latinx communities"] + scale = ["across the nation", "throughout the country", "nationwide", "across the country", "throughout the nation"] + + return f"{random.choice(h)} that police brutality is {random.choice(adjective)} {random.choice(noun)} that {random.choice(adverb)} {random.choice(verb)} {random.choice(p)} {random.choice(scale)}." + +def gen_more(): + i = ["This is unacceptable.", "This is intolerable.", "The status quo is failing us.", "The current system is failing us.", "The status quo needs to be reformed.", "The law enforcement system needs to be reformed."] + n = ["desire", "need", "yearning", "craving"] + a = ["systemic", "structural", "institutional"] + c = ["change", "reform"] + p = ["policing", "law enforcement"] + r = ["manifested in", "resulted in", "brought about"] + u = ["public unrest", "civil unrest", "protests and riots across the nation"] + + return f"{random.choice(i)} At this time, the {random.choice(n)} for {random.choice(a)} {random.choice(c)} to {random.choice(p)} has {random.choice(r)} {random.choice(u)}." + +def gen_suggest(): + f = ["funds", "resources", "energy", "money"] + a = ["must", "should", "need to"] + v = ["redirected", "diverted"] + s = ["services", "programs", "resources"] + r = ["reflect", "support"] + n = ["needs", "concerns", "desires"] + + return f"The city's {random.choice(f)} {random.choice(a)} be {random.choice(v)} to {random.choice(s)} that {random.choice(r)} the {random.choice(n)} of our community: {gen_interests()}." + +def gen_turnpoint(): + unacceptable = ["unacceptable", "indefensible", "inexcusable"] + change = ["systemic change to policing", "upheaval of current methods when it comes to policing", "eradication of racism in policing", "fundamental change to policing"] + covid = ["COVID19", "coronavirus", "the global pandemic"] + community = ["preserving community resources", "protecting community assets", "bolstering community healthcare"] + bolstering = ["excessively bolstering", "unnecessarily strengthening","toxically reinforcing", "disproportionately aiding"] + + r = random.randint(0,100) + if r < 33: + return f'This is {random.choice(unacceptable)}. At this time Black people and their allies are demanding {random.choice(change)}, and in light of {random.choice(covid)}, we need to restructure funding to focus on {random.choice(community)} instead of {random.choice(bolstering)} the police.\n' + elif r < 66: + return f'In this current political climate, while Black people and their allies are demanding {random.choice(change)}, this is {random.choice(unacceptable)}. We need to examine funding and ensure that it is {random.choice(community)}, as opposed to {random.choice(bolstering)} the police.\n' + else: + return f'We cannot continue to keep {random.choice(bolstering)} the police. The treatment of Black people in this country is {random.choice(unacceptable)}, and they alongside with their allies are demanding {random.choice(change)}. Especially given the extenuating circumstance of {random.choice(covid)}, we need to restructure funding to focus on {random.choice(community)}.\n' + + +def gen_redirect(): + programs = ["quality housing for all", "educational enrichment", "good jobs", "free and quality public transportation", "universal access to healthy food", "climate justice", "mental healthcare"] + needs = ["needs", "wants", "desires", "goals", "demands", "requirements"] + people = ["our community", "our society", "the people that make up our community", "the members of our community"] + redirect = ["redirect", "divert", "channel", "pivot"] + deserving = ["deserving", "worthy", "warranted", "commendable"] + + r = random.randint(0,100) + if r < 50: + return f'The budget of this city should be {random.choice(redirect)}ed into programs that support the {random.choice(needs)} of {random.choice(people)}: {", ".join(random.sample(programs, len(programs)-3))}, and small business resources amongst others.' + else: + return f'There are many programs that the city could invest in that would greatly benefit {random.choice(people)} like: {", ".join(random.sample(programs, len(programs)-3))} (only to name a few). You have the obligation to {random.choice(redirect)} the funds of your city from the police to a more {random.choice(deserving)} cause.' + + +def gen_final(): + nominer = ["As an elected official,", "Being that you have been elected to office,", "You are an elected official and", "As a public servant,", "You are a public servant and"] + choice = ["duty", "obligation", "responsibility", "requirement"] + wellbeing = ["benefiting all of", "serving", "helping", "taking care of", "assisting"] + people = ["your constituents", "those who elected you", "the people who put you in office", "your voters", "the members in your community"] + protection = ["overprotecting", "unfairly aiding", "shielding", "protecting"] + voices = ["make our voices heard", "speak out against injustice", "make our voices known", "speak up for our black community", "speak up until change is delivered"] + seek = ["seek", "intend", "toil", "make it a priority"] + + r = random.randint(0,100) + if r < 33: + return f'You should understand that {random.choice(protection)} the police is no longer an option. We will continue to {random.choice(voices)}, and you should {random.choice(seek)} to take action that benfits us. We are {random.choice(people)} and we deserve to be heard.' + elif r < 66: + return f'It is our {random.choice(choice)} to {random.choice(voices)} and it is yours to listen. You should {random.choice(seek)} to help {random.choice(people)}, instead of {random.choice(protection)} the police.' + else: + return f'{random.choice(nominer)} you have a {random.choice(choice)} to listen to your community, and focus on {random.choice(wellbeing)} {random.choice(people)} rather than {random.choice(protection)} the police. We will continue to {random.choice(voices)}.' diff --git a/inquire.py b/inquire.py new file mode 100644 index 0000000..94107cc --- /dev/null +++ b/inquire.py @@ -0,0 +1,114 @@ +import random +""" + Template credit: nomoreracistcops.github.io + Additional demands from: + https://secure.everyaction.com/eR7GA7oz70GL8doBq19LrA2 + https://docs.google.com/document/d/1V2l7bdg6QeqtqVWDr5HFzVzieiT0vg6jZASN6syBNyY/edit +""" + +def gen_message(location): + return f'{gen_intro(location)}\n\t{gen_curiosity()}\n\t{gen_conclusion()}' + +# Generates the first sentence of the email. +def gen_intro(location): + mess = ["in shambles", "in ruins", "a disaster", "a mess"] + nominer = ["As a concerned US resident,", "I am a resident of the United States and", "As a concerned American,"] + contact = ["getting in touch", "reaching out to you", "contacting you", "sending you this message"] + adverb = ["deeply", "very", "greatly", "extremely", "especially", "immensely"] + concern = ["troubled", "concerned", "disturbed", "distressed", "distraught", "worried", "devastated"] + reason = ["unfair treatment of African-Americans", "blatant racism against African-Americans", "unjust treatment of African-Americans", "violence against African-Americans", "atrocities against the African-American community"] + scale = ["across the nation", "throughout the country", "nationwide", "across the country", "throughout the nation"] + + r = random.randint(0,100) + if r < 33: + return f'The current law enforcement system is {random.choice(mess)}. I am {random.choice(contact)} because I am {random.choice(adverb)} {random.choice(concern)} by the {random.choice(reason)} by police {random.choice(scale)}.\n' + elif r < 66: + return f'I am {random.choice(contact)} because of the {random.choice(adverb)} disturbing cases of {random.choice(reason)} by law enforcement officers {random.choice(scale)}.\n' + else: + return f'{random.choice(nominer)} I am {random.choice(contact)} because I am {random.choice(adverb)} {random.choice(concern)} by what I have seen recently regarding the {random.choice(reason)} by police {random.choice(scale)}.\n' + +# Randomly generates a message rooted on human curiosity to expose the inadequacies of the current system +def gen_curiosity(): + verb = ["know", "inquire", "ask"] + noun = ["safeguards", "policies", "provisions"] + work = ["commitments", "efforts", "actions"] + crime = ["incidents of racism", "violations of human rights", "occurrences of racism", "exploitations of human rights"] + + if random.randint(0,100) % 2: + return f'As a public servant, what {random.choice(work)} will you make to protect black lives? In addition, what {random.choice(noun)} are in place to prevent {random.choice(crime)} by officers? {gen_rhetorical_questions()}\n' + else: + return f'I would like to {random.choice(verb)} what {random.choice(noun)} our police departments have in place to prevent {random.choice(crime)} by officers, and what {random.choice(work)} you will make to protect black lives. {gen_rhetorical_questions()}\n' + +#{NOTE} I want to change the ones that just say "incidents of racism" to stronger statements + +# Randomly generates a relentless stream of hard-hitting rhetorical questions +def gen_rhetorical_questions(): + q1 = [ + "Are all officers required to wear body cameras to record their responses to calls on video?", + "Do departments perform any form of anti-racism training for officers?", + "How do internal affairs investigate and respond to reports of discrimination, racism, and unjust brutality?", + "How can the general public be ensured that incidences of racist violence by police are not simply swept under the rug? In particular, how can I be sure that police officers are held accountable for their actions?", + ] + q2 = [ + "Will you develop a plan for defunding law enforcement, and reallocate these funds to critical social services?", + "Will you protect and expand current investment in community-led health and safety strategies, instead of investing in police?", + "What have you done to compel local law enforcement agencies to immediately cease enacting violence on community members?", + "How are you working on eliminating qualified immunity for police officers that has allowed too many incidents of police misconduct to disappear without consequence?", + ] + + return f"{' '.join(random.sample(q1,k=len(q1)))} {' '.join(random.sample(q2,k=len(q2)))}" + +def gen_conclusion(): + noun = ["safeguards", "policies", "provisions"] + adverb = ['certainly', 'definitely', 'absolutely', 'undoubtedly'] + verb = ["support", "want", "approve of"] + place = ["law enforcement agencies", "police departments", "government institutions", "public institutions"] + + r = random.randint(0,100) + if r % 2: + return f'If these {random.choice(noun)} are not in place, then they {random.choice(adverb)} should be. {gen_action()} I do not {random.choice(verb)} my local taxes being used to fund {random.choice(place)} that perpetuate racism and violence. {gen_interests()}\n\n\t{gen_gratitude()}' + else: + return f'These {random.choice(noun)} must be put into place to protect American rights and lives. As a taxpayer, I do not {random.choice(verb)} my taxes being used to fund {random.choice(place)} that perpetuate institutional racism and violence. {gen_interests()}\n\n\t{gen_gratitude()}' + +def gen_action(): + bank = [ + "The status quo is failing us. Reforms to law enforcement agencies, along with the redirection of funds, must be enacted.", + "The current system isn't working and changes must be made to how law is enforced and funded in this country.", + "This issue is nothing new. The frequency of these incidents suggest that law enforcement is a force of violence, not public safety, in our country.", + ] + + return random.choice(bank) + +def gen_interests(): + noun = [ 'Services', 'Programs'] + preamble = [ + f'{random.choice(noun)} that I would rather see funded include: ', + 'I would like to redirect funding to', + ] + return f'{random.choice(preamble)} {gen_services()} to name only a few.' + +def gen_services(): + i = [ + "mental health professionals,", + "crisis de-escalators,", + "support for victims of domestic abuse and addiction,", + "public education,", + "scientific research,", + "increased social services for formerly incarcerated residents", + "increased funding for nutrition and food access programs" + ] + return ' '.join(random.sample(i, k=len(i))) + +def gen_gratitude(): + clauses = [ + "Thank you for your attention to my concerns.", + "Thanks for taking the time to read my message.", + "Your attention to my concerns is very appreciated.", + ] + finale = [ + "I hope to hear back from you soon.", + "I'm hoping to hear back from you soon.", + "I look forward to hearing back from you.", + ] + + return f'{random.choice(clauses)} {random.choice(finale)}' diff --git a/messages.py b/messages.py index 06d2520..d4a4fbd 100644 --- a/messages.py +++ b/messages.py @@ -1,11 +1,6 @@ import random - -""" - Template credit: nomoreracistcops.github.io - Additional demands from: - https://secure.everyaction.com/eR7GA7oz70GL8doBq19LrA2 - https://docs.google.com/document/d/1V2l7bdg6QeqtqVWDr5HFzVzieiT0vg6jZASN6syBNyY/edit -""" +import inquire as inq +import demand as dem # Randomly generates the subject header of the email def gen_subject(): @@ -14,7 +9,11 @@ def gen_subject(): # Randomly generates the body of the email, follows structure of template and swaps out select words/phrases def gen_body(src_name, dst_name, location): - return f'{gen_greeting(dst_name)}\t{gen_intro(location)}\n\t{gen_curiosity()}\n\t{gen_conclusion(src_name)}' + r = random.randint(0,100) + if r < 50: + return f'{gen_greeting(dst_name)}\t{inq.gen_message(location)}\n{gen_closing(src_name)}' + else: + return f'{gen_greeting(dst_name)}\t{dem.gen_message(src_name)}\n{gen_closing(src_name)}' # Generates the greeting to the recipient of the email def gen_greeting(person): @@ -26,109 +25,6 @@ def attach_greeting(person, body): s = ["Dear", "Hello", "Greetings", "Hi"] return f'{random.choice(s)} {person},\n\n{body}' -# Generates the first sentence of the email. -def gen_intro(location): - mess = ["in shambles", "in ruins", "a disaster", "a mess"] - nominer = ["As a concerned US resident,", "I am a resident of the United States and", "As a concerned American,"] - contact = ["getting in touch", "reaching out to you", "contacting you", "sending you this message"] - adverb = ["deeply", "very", "greatly", "extremely", "especially", "immensely"] - concern = ["troubled", "concerned", "disturbed", "distressed", "distraught", "worried", "devastated"] - reason = ["unfair treatment of African-Americans", "blatant racism against African-Americans", "unjust treatment of African-Americans", "violence against African-Americans", "atrocities against the African-American community"] - scale = ["across the nation", "throughout the country", "nationwide", "across the country", "throughout the nation"] - - r = random.randint(0,100) - if r < 33: - return f'The current law enforcement system is {random.choice(mess)}. I am {random.choice(contact)} because I am {random.choice(adverb)} {random.choice(concern)} by the {random.choice(reason)} by police {random.choice(scale)}.\n' - elif r < 66: - return f'I am {random.choice(contact)} because of the {random.choice(adverb)} disturbing cases of {random.choice(reason)} by law enforcement officers {random.choice(scale)}.\n' - else: - return f'{random.choice(nominer)} I am {random.choice(contact)} because I am {random.choice(adverb)} {random.choice(concern)} by what I have seen recently regarding the {random.choice(reason)} by police {random.choice(scale)}.\n' - -# Randomly generates a message rooted on human curiosity to expose the inadequacies of the current system -def gen_curiosity(): - verb = ["know", "inquire", "ask"] - noun = ["safeguards", "policies", "provisions"] - work = ["commitments", "efforts", "actions"] - crime = ["incidents of racism", "violations of human rights", "occurrences of racism", "exploitations of human rights"] - - if random.randint(0,100) % 2: - return f'As a public servant, what {random.choice(work)} will you make to protect black lives? In addition, what {random.choice(noun)} are in place to prevent {random.choice(crime)} by officers? {gen_rhetorical_questions()}\n' - else: - return f'I would like to {random.choice(verb)} what {random.choice(noun)} our police departments have in place to prevent {random.choice(crime)} by officers, and what {random.choice(work)} you will make to protect black lives. {gen_rhetorical_questions()}\n' - -#{NOTE} I want to change the ones that just say "incidents of racism" to stronger statements - -# Randomly generates a relentless stream of hard-hitting rhetorical questions -def gen_rhetorical_questions(): - q1 = [ - "Are all officers required to wear body cameras to record their responses to calls on video?", - "Do departments perform any form of anti-racism training for officers?", - "How do internal affairs investigate and respond to reports of discrimination, racism, and unjust brutality?", - "How can the general public be ensured that incidences of racist violence by police are not simply swept under the rug? In particular, how can I be sure that police officers are held accountable for their actions?", - ] - q2 = [ - "Will you develop a plan for defunding law enforcement, and reallocate these funds to critical social services?", - "Will you protect and expand current investment in community-led health and safety strategies, instead of investing in police?", - "What have you done to compel local law enforcement agencies to immediately cease enacting violence on community members?", - "How are you working on eliminating qualified immunity for police officers that has allowed too many incidents of police misconduct to disappear without consequence?", - ] - - return f"{' '.join(random.sample(q1,k=len(q1)))} {' '.join(random.sample(q2,k=len(q2)))}" - -def gen_conclusion(name): - noun = ["safeguards", "policies", "provisions"] - adverb = ['certainly', 'definitely', 'absolutely', 'undoubtedly'] - verb = ["support", "want", "approve of"] - place = ["law enforcement agencies", "police departments", "government institutions", "public institutions"] - - r = random.randint(0,100) - if r % 2: - return f'If these {random.choice(noun)} are not in place, then they {random.choice(adverb)} should be. {gen_action()} I do not {random.choice(verb)} my local taxes being used to fund {random.choice(place)} that perpetuate racism and violence. {gen_interests()}\n\n\t{gen_gratitude()}\n{gen_closing(name)}' - else: - return f'These {random.choice(noun)} must be put into place to protect American rights and lives. As a taxpayer, I do not {random.choice(verb)} my taxes being used to fund {random.choice(place)} that perpetuate institutional racism and violence. {gen_interests()}\n\n\t{gen_gratitude()}\n{gen_closing(name)}' - -def gen_action(): - bank = [ - "The status quo is failing us. Reforms to law enforcement agencies, along with the redirection of funds, must be enacted.", - "The current system isn't working and changes must be made to how law is enforced and funded in this country.", - "This issue is nothing new. The frequency of these incidents suggest that law enforcement is a force of violence, not public safety, in our country.", - ] - - return random.choice(bank) - -def gen_interests(): - noun = [ 'Services', 'Programs'] - preamble = [ - f'{random.choice(noun)} that I would rather see funded include: ', - 'I would like to redirect funding to', - ] - return f'{random.choice(preamble)} {gen_services()} to name only a few.' - -def gen_services(): - i = [ - "mental health professionals,", - "crisis de-escalators,", - "support for victims of domestic abuse and addiction,", - "public education,", - "scientific research,", - "increased social services for formerly incarcerated residents", - "increased funding for nutrition and food access programs" - ] - return ' '.join(random.sample(i, k=len(i))) - -def gen_gratitude(): - clauses = [ - "Thank you for your attention to my concerns.", - "Thanks for taking the time to read my message.", - "Your attention to my concerns is very appreciated.", - ] - finale = [ - "I hope to hear back from you soon.", - "I'm hoping to hear back from you soon.", - "I look forward to hearing back from you.", - ] - - return f'{random.choice(clauses)} {random.choice(finale)}' def gen_closing(name): c = [ @@ -139,4 +35,3 @@ def gen_closing(name): "Best", ] return f'\n{random.choice(c)},\n{name}' -print(gen_body("a","a",'a')) diff --git a/send.py b/send.py index b562802..3e0e20c 100755 --- a/send.py +++ b/send.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import messages, recipients, smtplib, ssl, states, sys, time +import logging, messages, recipients, smtplib, ssl, states, sys, time from getpass import getpass from email.message import EmailMessage