Marlon.io

Based on the template of the personally written Security Alerts sent out by our college's VP of security, Marlon Lynch (for whom this app is named), we decided that a "local crimes" newsletter-type service could be one that some residents of Chicago might find useful, since Mailjet makes it easy to send well-formatted HTML emails. We've had some work with civic data in the past, so it was simple to obtain the relevant data via Plenar.io.

After that, it wasn't hard to get a Flask server up and running which could create and store a subscriber base. We then wrote a script in R to obtain, clean, subset, and transform the data into readable strings. It was then a simple matter to have a Python function call the script, then format the strings into an email and use Mailjet to send them.

Then if the main app is up and running, the Python script to send all the emails is run weekly (every Monday) using an integration of task manager Celery into Flask, with database Redis as a backend.

Note there's also an incomplete feature which creates a map. For both that and how to run/demo the project, the README on Github is helpful.

The completed feature that we're most proud of is probably the Celery/Flask integration to run the periodic process, since the documentation on that is a bit sketchy for the most recent versions. To be able to run a server locally which actually can accomplish the weekly mailings is very cool. The R/Python calling was also neat; I haven't mixed server-side scripting like that in the past, but it was necessary because my partner and I have very different coding strengths.

I uploaded a .zip of the project just in case, though the git repository listed as the website URL should work fine.

Share this project:
×

Updates