Police Accountability: My CLI Project

Victor Williams
4 min readJun 29, 2020

My first Command Line Interface project was both inspiring and challenging. As I’ve probably said a number of times, I believe there are tons of ways for developers to engage the Political without necessarily being political. In other words, there are plenty of ways to use our skills for the betterment of our society.

My first attempt at this started with this tweet:

@ItzHunnieB_ on Twitter

A tweet that voiced, in one of the blackest ways possible, the frustrating power dynamic between Black people and law enforcement. At a time when more people were beginning to question the efficacy of police and their very discriminate use of deadly force, I believed it was only right to use the skills I’d learned (thus far) to create some kind of functioning Ruby gem to begin the long process of dismantling a lopsided, parasitic relationship.

That begins with access to information.

Step 1. I started by brainstorming about what kind of app I wanted to create. What would my app do? Here’s what I thought of at first:

user enters officer name, part of name, vehicle license plate, or badge number or whatever variables that are manageable.

outputs first data set that matches user input as “[officer name], [police department]? Y/n”

if Y, outputs officer badge number, rank, gender, and race

if n, sends user to next officer name + police department

if n again, sends user to next officer name + department — loop

if program has no more data to output to user, program outputs "I'm sorry. That officer doesn't seem to be in the database." Then takes user back to main menu.

But that fell through FAST; mainly because I was in over my head. I was asking too much of myself for the knowledge I had. I had no idea how to code a program that would allow the user to search and return possible matches.

I had to learn that it’s okay for the vision you had for something to be shattered by reality. It’s sobering.

I moved on. After all, I had a lot more to plan out!

Would I scrape (get data by inspecting the HTML of a website) or use an API (an interface of data, from an organization, company, or government agency, specially made for public programming consumption)? You’d probably think a bunch of organizations would have gathered a record of police info & complaints by now to create an API but you, just like me, would be mistaken.

The information was barely out there and when I finally found the website I needed (OpenOversight), I was only able to gather so much. I decided to scrape the site for a few individual officers to get the ball rolling.

Now that I’m standing on the other side of 25 hours of effort, I’m beginning to realize that taking an abstract concept that you hope would help change the world is a much more grueling process than you’d imagine. But here’s the silver lining: it is very doable. The gem bundler came with everything I needed for GitHub’s README section (including installation instructions and the whole 9 yards)!

Step 2. After brainstorming for a minute, I started coding out the fundamentals. I knew I would need about 2 classes: one stored as CLI.rb (“rb” to tell everyone it’s a Ruby file) to house my gem’s vital running code and another stored as Officer.rb to house all the scraping I’d need to figure out in order to get the information about the officers. The CLI class would rely on the Officer class to get the officer information from OpenOversight.

I also knew I wanted the user to be able to select from one list to get more information output as another list; the user would select an officer to get more information on. This is what the project requirements called “levels” and I only need one.

Step 3. Now I’m deeper in the coding process and I’m running into error after error! At times, I forgot to define an instance variable method (the machine that I’d call on to do my bidding later on). At other times, I just had to Google my way through and eventually get to some working code just to be able to run my program and it not work the way I wanted it to. This was honestly the most time-consuming part of the project but also one of the most rewarding. Getting the program to work piece-by-piece made the entire process worth it.

I also didn’t wanna fail so that was a pretty big motivator.

Step 4. Here we are! The program is working and I just have to work out the rough patches to make sure my code won’t break down if the user enters the wrong input or if the loop I created would keep going even after the user wanted to go back to the main menu. It’s all logic at this point! This is where brainstorming and outlining really come into play.

Although my project wasn’t what I had originally envisioned, I’m still proud that I stood by the original conception in spirit and even somewhat in practice! The Popo Gem allows users to search a list of officers from the Chicago Police Department and get more information (like the officer’s name, badge number, sex, and age) on the officer of their choice. Believe me, this is only the first step of an even longer process that leads to leveling the playing field and holding law enforcement accountable to the people they are sworn to protect.

--

--

Victor Williams

Software Engineering student. “God gives nothing to those who keep their arms crossed.”