Canadian Cheese Directory

Apr 30, 2015 00:00 · 344 words · 2 minutes read golang

Publishing data in CSV format is highly efficient for transmission but that is where the story ends for most other use cases. The Canada Open Data Portal has a great many datasets available for analysis, and one such dataset is the Canadian Cheese Directory. This lists 1,400+ cheeses made in Canada, with details such as where they are made, how sharp they are, how long their ripening process is, and other such facts.

This data is in a very easy to download yet difficult to consume CSV format, so I took the opportunity to make my April app a parser which pulls this data directly, and then converts it to the more useful and human readable JSON format.

In the native CSV format, the data looks like this:

730,Eweda (Best Baa Dairy),,Ewenity Dairy Co-operative,,ON,Artisan,Artisanale,,,32.00,47.00,made with gouda recipe but with a very different taste,Recette du gouda mais avec un gout different,,,,,1 Month,1 mois,0,Semi-soft Cheese,Pâte demi-ferme,Ewe,Brebis,Pasteurized,Pasteurisé,,,2015-02-06

And this is how the data looks in JSON:

        "CheeseId": "730",
        "CheeseNameEn": "Eweda (Best Baa Dairy)",
        "CheeseNameFr": "",
        "ManufacturerNameEn": "Ewenity Dairy Co-operative",
        "ManufacturerNameFr": "",
        "ManufacturerProvCode": "ON",
        "ManufacturingTypeEn": "Artisan",
        "ManufacturingTypeFr": "Artisanale",
        "WebSiteEn": "",
        "WebSiteFr": "",
        "FatContentPercent": "32.00",
        "MoisturePercent": "47.00",
        "ParticularitiesEn": "made with gouda recipe but with a very different taste",
        "ParticularitiesFr": "Recette du gouda mais avec un gout different",
        "FlavourEn": "",
        "FlavourFr": "",
        "CharacteristicsEn": "",
        "CharacteristicsFr": "",
        "RipeningEn": "1 Month",
        "RipeningFr": "1 mois",
        "Organic": "0",
        "CategoryTypeEn": "Semi-soft Cheese",
        "CategoryTypeFr": "Pâte demi-ferme",
        "MilkTypeEn": "Ewe",
        "MilkTypeFr": "Brebis",
        "MilkTreatmentTypeEn": "Pasteurized",
        "MilkTreatmentTypeFr": "Pasteurisé",
        "RindTypeEn": "",
        "RindTypeFr": "",
        "LastUpdateDate": "2015-02-06"

For this month I decided to get started learning Golang, the virtues of which have been sung to me from several sources. Golang is very pleasant to use, and whilst I have yet to get into its primary specialties of goroutines (threads), channels (concurrency) and interfaces (alternative to OO), it has been easy to pickup, and quite rational. I enjoy it, a lot. Maybe this will be the language of choice for App #5.

Without further ado, you can find my Canadian Cheese Directory to JSON tool on my GitHub.

Source Code at GitHub