govhack 2021 - stolen vehicles

So I did GovHack again this year. I've done this every year since 2016 or so.

The challenge that I decided on was:

Engaging with SmartView-Go: Encouraging interaction between citizens and their city

One of the aspects of the SmartView-Go was information on Stolen Vehicles. So I decided to work on that.

The police release the data in a CSV file but only have the past 6 months. I decided to write code in golang that would do a few things:

Take the data from the CSV file and feed it into a database (decided on using SQL Server thanks to Microsoft Azure giving me 100 dollars credit). I used GORM again to talk to the the database - though this was the first time I had used SQL Server with Golang / GORM.

Then have the ability to query the database via a API - I used Gin again.

The code for the project can be found here:

William Mckee / stolenvehicles-govhack2021

I am happy with the code that opens the csv file, and loops over each line - splitting and writing to the database. I hadn't really used for loop with Golang much, so it was a good opportunity to.

My project can be found on GovHack Hackerspace here:

StolenVehicles | Hackerspace

Also as a requirement to submit I made a video talking about the project

Subscribe to wmckee

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
Contents © 2020 William Mckee Creative Commons Attribution 4.0 International License
wmckee by William Mckee is licensed under a Creative Commons Attribution 4.0 International License.