Code Monkey home page Code Monkey logo

vinmonopolet_vegan's Introduction

Finds vegan wines in Vinmonopolet's product list, using the Barnivore API (http://barnivore.com/old-api). Employs fuzzy matching, as the manufacturer names in the databases don't always match, because of abbreviations and omissions of certain generic words in the full company name.

Uses python 3.x.

Install it like this (Ubuntu/Debian):

sudo apt-get install python3

Or for Mac: Install homebrew, then

brew install python3

Then install required dependencies:

pip3 install beautifulsoup4 --upgrade
pip3 install requests --upgrade
pip3 install fuzzywuzzy[speedup] --upgrade

Get the updated wine.json from http://barnivore.com/wine.json
It may have encoding errors, invalid utf-8 in it.

Fix it with this command:

iconv --verbose -f utf-8 -t utf-8//ignore wine.json > winenew.json && mv winenew.json wine.json

Get the updated product list from Vinmonopolet, described at https://www.vinmonopolet.no/datadeling/csv, available at https://www.vinmonopolet.no/medias/sys_master/products/products/hbc/hb0/8834253127710/produkter.csv

Run

python3 vegan_wine_search.py

and validate the resulting list in the json files

Tips for validating the list

The list will include false positives because of the intentional fuzzy matching of manufacturers' names. Regexp-search for Varenavn|manufacturer_name in the json file to highlight these fields. Then for each company's wine list check if there is a name mismatch. Also check for when countries don't match exactly (dev.country_mismatch = true entries). Then delete bad ones.

After that, parse the json using generatehtml.py to produce a human-readable HTML page

vinmonopolet_vegan's People

Contributors

perchrh avatar

Stargazers

 avatar

Watchers

 avatar  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.