This program parses a comma separated dataset containing building code violations, and it calculates number of violations in each category, and the earliest and latest violation date for each category. The results are logged out to the console and exported to a new csv file violations_by_category.csv
.
Download dataset from Code for America.
Christine Feaster (@femmestem)
This project is written using the Ruby standard library.
To check your ruby version, run $ ruby --version
. If your version is 2.2.0, then you’re good to go.
If not, download RVM if not already installed, then run $ rvm list
to see your installed ruby versions. If you have 2.2.0 installed, run $ rvm use ruby-2.2.0
. Otherwise, install or update your ruby version with RVM.
- Download or clone this repository from GitHub
$ git clone https://github.com/femmestem/building-code-violations.git building-code-violations
- Change directory into the project folder
$ cd building-code-violations
- To execute the script, run:
$ ruby application.rb
This will create a new csv fileviolations_by_category.csv
in the project root directory that contains number of violations in each category, and the earliest and latest violation date for each category.