Commit 66fed296 by Javi Mateos

query a beerrate

parent 8fd55f68
File mode changed from 100644 to 100755
{u'data': {u'beerSearch': {u'items': [{u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'23010', u'name': u'YellowBelly Beer'}, u'name': u'Gose to Leipzig', u'description': u'Continuing with our historical interpretations, we kept our Gose (Goes-Ah) as true to style as possible. We mashed half and half pilsner and wheat malt and introduced souring bacteria, around half the amount of our regular sours, before boiling with coriander and Himalayan rock salt. The resulting beer has a very subdued aroma of coriander with a moreish salinity and slightly acidic finish.'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'3795', u'name': u'Gasthaus & Gosebrauerei Bayerischer Bahnhof'}, u'name': u'Bayerischer Bahnhof Original Leipziger Gose', u'description': u'This original Leipzig beer specialty lends us the name for our brewery. Gose is a regional beer specialty that was brought to Saxony-Anhalt in the year 1738. Originally Gose comes from Goslar, a small town in Lower Saxony, and the river \u201cGose\u201d in this town. This beer specialty has a refreshing, slightly sour taste and is ideal for quenching your thirst. Gose is brewed with the additional ingredients lactic acid, cilantro, and salt. Gose is a top-fermented beer with 4,5 Vol. % alcohol and 10,8 % wort. You can enjoy it in different variations.'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'12402', u'name': u'Westbrook Brewing'}, u'name': u'Westbrook Gose', u'description': u'This is our interpretation of Gose (pronounced \u201cGose-uh\u201d), a traditional German-style sour wheat beer brewed with coriander and salt. Once nearly extinct, this very refreshing style is making a comeback.'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'60', u'name': u'Anderson Valley Brewing Company'}, u'name': u'Anderson Valley Highway 128 The Kimmie, The Yink, and the Holy Gose', u'description': u'The refreshing tartness in this divine, bright golden-colored ale gives way to earthy undertones and hints of citrus followed by a slight sea salt-like dryness and tangy, effervescent finish.\r\n\r\nMALTS: Pale Two-Row, Malted White Wheat\r\n\r\nHOPS: Bravo'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'16075', u'name': u'Ritterguts Gose'}, u'name': u'Original Ritterguts Gose', u'description': u'Ritterguts Gose is a top-fermented, sourish and slightly salty-tasting ale that was first brewed in 1824. It is the beer specialty of Leipzig and the oldest still existing Gose brand in the world. Gose is an own, ancient style of beer that does not correspond to the German purity law. Even today, it is still brewed with an admixture of coriander and salt in the traditional way with the special historic Gose yeast in open fermentation. Its particular character our Gose gets thereby and by the additional lactate fermentation.Brewed by Hartmannsdorf until 2014 (until 2007 @3.9%, then 4.2%), brewed by Reichenbrand in Chemnitz from 2015.\r\nWorld Beer Awards London: World\u2019s Best Gose 2013, Europe\u2019s Best Gose 2014, World Beer Idol 2016: Gose Gold, World Beer Cup 2016: Bronze Medal'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'60', u'name': u'Anderson Valley Brewing Company'}, u'name': u'Anderson Valley Highway 128 Blood Orange Gose', u'description': u'Our Blood Orange Gose is a tart, refreshing wheat ale that is kettle-soured with lactobacillus and brewed with sea salt and coriander. However, unlike traditional versions of the style, ours features liberal additions of blood oranges during fermentation. This imparts tangy citrus notes that complement the champagne-like flavors, creating a complex and sessionable ale perfect for any occasion. \r\n\r\nMALTS: Pale Two-Row, Malted White Wheat\r\n\r\nHOPS: Bravo'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'101', u'name': u'Victory Brewing Company (ABV)'}, u'name': u'Victory Kirsch Gose', u'description': u'A bold and bright step outside the norm, this new twist on an old-world German brewing process excites your senses with the sharp and sweet burst of fresh cherries. Effervescent and sublime, this session ale has an enticing and satisfying cherry fruit character. European tradition and American ingenuity come together in the truest sense as you Taste Victory in Kirsch Gose.'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'12578', u'name': u'Omnipollo'}, u'name': u'Omnipollo Bianca Mango Lassi Gose 6%', u'description': u'Gose brewed with rock salt, lactose and mango pur\xe9e.Some batches have had an ABV of 3.8% or 3.5%.'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'13058', u'name': u'Almanac Beer Company'}, u'name': u'Almanac Golden Gate Gose', u'description': u'Our Golden Gate Gose is a special draft-only beer inspired by the classic wheat beer hailing from Leipzig, Germany. Traditionally brewed with salt and coriander, our tart California-inspried version is brewed with San Francisco Bay sea salt, lemon verbena and coriander grown especially for us by Dirty Girl Produce in Santa Cruz, California. Fermented with our house saison yeast, this delicate and tart beer is a perfect summer refresher. Pair with fresh seafood and sunshine. [Alias with Flowering Gose?]'}, {u'style': {u'name': u'Grodziskie/Gose/Lichtenhainer'}, u'brewer': {u'id': u'60', u'name': u'Anderson Valley Brewing Company'}, u'name': u'Anderson Valley Briney Melon Gose', u'description': u'Born from our passion for experimentation, our Briney Melon Gose boasts a thirst-quenching tartness that is perfectly balanced by subtle watermelon flavors and aromas. Gentle additions of sea salt create a refreshing harmony between the acidity and fruity sweetness leading to clean, dry finish.\r\nMALTS: Pale Two-Row, Malted White Wheat\r\nHOPS: Bravo'}]}}}
#!/usr/bin/python
import requests
import json
API_KEY = "Wma2WTgsEJ7DytljxUoK5a0G2IHqiTWz5Vxkezu7"
beer_template = """
{
beerSearch(query: "%s") {
items {
name
style {
name
}
brewer {
name
}
ibu
abv
overallScore
}
}
}
"""
search_template = """
query {
beerSearch(query:"%s"){
items{
name,
description,
style{
name
}
brewer{
id,
name
}
}
}
}
"""
def search(query):
response = requests.post(
"https://api.r8.beer/v1/api/graphql/",
data=json.dumps(
{"query": beer_template % query}
),
headers={
"content-type": "application/json",
"accept": "application/json",
"x-api-key": API_KEY
}
)
return response.json()
if __name__ == '__main__':
import sys
resp = search(" ".join(sys.argv[1:]))
print resp
#!/usr/bin/python
import json
from pprint import pprint
data = json.load(open('data.json'))
pprint(data)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment