Git Product home page Git Product logo

dc-crime's Introduction

dc-crime

A dashboard that displays a count of violent crimes in Washington, DC as reported by the Metropolitan Police Department on Twitter. Vist the live site here.

What it is

This project is a dashboard, designed to provide transparency into the number of violent crimes in DC.

The app displays a count of the total reported shooting and robberies in DC year to date. These counts are lower bound estimates. The DC Police deparment sends out alets via Twitter whena violent crime occurs. The numbers on this dashboard are derived by aggregating these Tweets. Tweets are then parsed for key words, categorized, and counted accordingly.

This is a Django app which relies on Tweepy for Twitter API access and Django-Celery-Beat for the execution of daily tasks.

Why I built it

Violent crime has risen dramatically over the last five years in Washington, D.C. Shooting are commonplace in the neighborhood I live in. At the beginning of 2022, I was walking to get pizza when a drive by happened a few hundred feet away. I've noticed that the data on the DC police department's website far under-reports the incidence of crime. Strangely, the department does do a pretty good job of consistently sending out alerts via Twitter when crimes occur.

Many residents are upset by the crime in the city. As a small contribution to transparency, I built this dashboard to keep tabs on how many alerts the police have sent out year to date.

Features

  • Dashboard displaying count of shootings and robberies year to date
  • Automated daily updates

Technologies

  • Python
  • Django
  • Tweepy
  • Django Celery Beat
  • Redis Message Broker
  • PostgreSQL Database
  • HTML, CSS, Bootstrap frontend
  • Heroku deployment

Future work

Features

  • Add error handling to alert me when if data pull is unsucccessful
  • Once data has built up, add charts for seasonal trends

Other ideas

  • The key word parsing is very primitive, but fairly good at capturing the intended tweets. I would like to explore variations of this parsing and programmatically compare their performance.
  • At the end of the year I would like to compare this data to DC's offical reported data. My theory is that the department is under-reporting violent crime by a significant margin.

Reflections and learnings

This project taught me how to set up and deploy recurring tasks. In this case, a daily job runs which pulls data from an API, parses it, and creates a database entry. I used django-celery-beat and Redis as a message broker to accomplish this.

This was a useful learning experience for me. First, it allowed me to practice figuring out something completely new: comparing technologies I could utilize, diving into new documentation, and designing a way to integrate a solution into my app. It wasn't immediately obvious how I should aggregate and store data. I enjoyed talking over my logic with more experience engineers. Second, this project opens up the door to building other apps which depend on recurring tasks such as batch data processing or user communications.

dc-crime's People

Contributors

mattambrogi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.