No description, website, or topics provided.
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
beertools
bin
geoloc_data
.gitignore
CHANGES.txt
LICENSE.txt
MANIFEST
MANIFEST.in
README.MD
README.txt
beer_compare_fasit.txt
beername_compare.py
breweryname_compare.py
err_polet.txt
get_osm_breweries.py
register.py
requirements.txt
setup.cfg
setup.py

README.MD

Beertools

A collection of pyhon scripts to work with beer and brewery data.

Setup

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Install package

pip install beertools

read_pol_beers

A script to fetch beers from Vinmonopolet, returns a flat json-structure. Use either as command line:

python -m read_pol_beers destination.json

Or in your script:

from beertools import read_pol_beers
beers = read_pol_beers()

read_ratebeer_beers

A script to fetch beers from Ratebeer, returns a flat json-structure.

This script uses the new Ratebeer-dump, and includes more data, but not brewery names. Use ratebeer_breweries_parser.py and match on brewery_id

Use either as command line:

python -m read_ratebeer_beers destination.json

Or in your script:

from beertools import read_ratebeer_beers
beers = read_ratebeer_beers()

read_ratebeer_breweries

Use either as command line:

python -m read_ratebeer_breweries destination.json

Or in your script:

from beertools import read_ratebeer_breweries
breweries = read_ratebeer_breweries()

BreweryNameMatcher

A tool to match brewery names, tuned to match vinmonopolet against ratebeer.

Usage:

from beertools import BreweryNameMatcher
matcher = BreweryNameMatcher(breweries) # a list of dicts with at least a "name" attribute
match = matcher.match_name('brewery name') # returns dict from list or None

BeerNameMatcher

A tool to match brewery names, tuned to match vinmonopolet against ratebeer.

Usage:

from beertools import BeerNameMatcher
matcher = BeerNameMatcher('brewery_name', beeer_list, skip_retired=True)
match = matcher.match_name('beer_name', abv=4.5) # returns dict from list or None

Tests

Run tests with

cd beertools
python -m unittest tests