Git Product home page Git Product logo

punkapi's Introduction

punkapi-db Build Status

Crowd Sourcing an API from BrewDog's hugely generous DIY Dog

In the spirit of DIY & giving back I thought I would attempt to collect all the BrewDog Recipes from their DIY Dog pdf and create an api from it!

You can find the API at https://punkapi.com and it's completely free!

If you are looking for the source code for the server that powers https://punkapi.com head over to samjbmason/punkapi-server

What's the deal?

This repo contains all the individual files for each recipe in the DIY Dog pdf (data). It also contains a singular JSON file data.json that contains all the recipes in one single file.

It's the data.json file that actually powers the punkapi API.

Installation

$ npm i --save punkapi-db

Usage

const punkapi = require('punkapi-db')

Libraries

These are user contributed wrappers for the API

The Beers

Status: 325 of 325 completed

If you find an issue with a recipe, please feel free to submit an issue

  • 001 - Punk IPA 2007 – 2010
  • 002 - Punk IPA 2010 – current
  • 003 - The Physics
  • 004 - Riptide
  • 005 - Hop Rocker
  • 006 - Paradox Islay
  • 007 - Paradox Jura
  • 008 - Peroxide Punk
  • 009 - Hype
  • 010 - Buzz
  • 011 - Edge
  • 012 - Storm
  • 013 - Cult Lager
  • 014 - Trashy Blonde
  • 015 - Original Dogma (Née Speedball)
  • 016 - AB:03
  • 017 - Zeitgeist
  • 018 - Bad Pixie
  • 019 - Chaos Theory
  • 020 - Zephyr
  • 021 - Coffee Imperial Stout
  • 022 - Devine Rebel
  • 023 - 77 Lager
  • 024 - Atlantic IPA
  • 025 - How To Disappear Completely
  • 026 - 5AM Saint
  • 027 - Tokyo Rising Sun Highland
  • 028 - Tokyo Rising Sun Lowland
  • 029 - Tokyo*
  • 030 - Punk Monk
  • 031 - Bashah
  • 032 - Nanny State
  • 033 - Tactical Nuclear Penguin
  • 034 - Eurotrash
  • 035 - Movember
  • 036 - Black Dog
  • 037 - Hardcore IPA
  • 038 - Sink The Bismarck!
  • 039 - Alpha Dog
  • 040 - Skull Candy
  • 041 - AB:01
  • 042 - AB:07
  • 043 - Prototype 27
  • 044 - TM10
  • 045 - AB:02
  • 046 - Hardkogt IPA
  • 047 - AB:04
  • 048 - Alice Porter
  • 049 - Santa Paws
  • 050 - AB:09
  • 051 - Black Tokyo Horizon
  • 052 - AB:05
  • 053 - Hello My Name Is Ingrid
  • 054 - IPA Is Dead: Bramling X
  • 055 - IPA Is Dead: Citra
  • 056 - IPA Is Dead: Nelson Sauvin
  • 057 - IPA Is Dead: Sorachi Ace
  • 058 - Avery Brown Dredge
  • 059 - Growler
  • 060 - Rabiator
  • 061 - AB:06
  • 062 - Juniper Wheat Beer
  • 063 - The End Of History
  • 064 - Hops Kill Nazis
  • 065 - Mr. Miyagi's Wasabi Stout
  • 066 - Sunk Punk
  • 067 - AB:10
  • 068 - AB:18
  • 069 - Old World India Pale Ale
  • 070 - Old World Russian Imperial Stout
  • 071 - Lost Dog
  • 072 - AB:08
  • 073 - Sunmaid Stout
  • 074 - Shareholder Brew: Black IPA
  • 075 - AB:13
  • 076 - IPA Is Dead: Simcoe
  • 077 - Libertine Porter
  • 078 - Mixtape 8
  • 079 - Bitch Please
  • 080 - IPA Is Dead: Challenger
  • 081 - IPA Is Dead: Galaxy
  • 082 - IPA Is Dead: HBC 369
  • 083 - IPA Is Dead: Motueka
  • 084 - Dead Pony Club
  • 085 - Libertine Black Ale
  • 086 - Anarchist Alchemist
  • 087 - Dog A
  • 088 - Hunter Foundation Pale Ale
  • 089 - AB:19
  • 090 - Jack Hammer
  • 091 - Never Mind The Anabolics
  • 092 - San Diego Scotch Ale
  • 093 - AB:12
  • 094 - White Noise
  • 095 - International Arms Race
  • 096 - AB:11
  • 097 - Hello My Name Is Beastie
  • 098 - Dog Fight
  • 099 - Hoppy Christmas
  • 100 - Black Eyed King Imp
  • 101 - Cocoa Psycho
  • 102 - Nuns With Guns
  • 103 - Catherine's Pony
  • 104 - IPA Is Dead: Amarillo
  • 105 - Lichtenstein Pale Ale
  • 106 - AB:14
  • 107 - IPA Is Dead: Dana
  • 108 - IPA Is Dead: El Dorado
  • 109 - IPA Is Dead: Goldings
  • 110 - IPA Is Dead: Waimea
  • 111 - Vagabond Pilsner
  • 112 - AB:15
  • 113 - Bracken's Porter
  • 114 - Fake Lager
  • 115 - 10 Heads High
  • 116 - Vice Bier
  • 117 - Misspent Youth
  • 118 - #Mashtag 2013
  • 119 - Dog B
  • 120 - Electric India
  • 121 - Dog Wired
  • 122 - Hello My Name Is Mette-Marit
  • 123 - Everyday Anarchy
  • 124 - Black Jacques
  • 125 - Blitz Berliner Weisse
  • 126 - Dogma
  • 127 - Hello My Name Is Sonja
  • 128 - Shipwrecker Circus
  • 129 - Dead Metaphor
  • 130 - Baby Dogma
  • 131 - Unleash The Yeast: American Ale
  • 132 - Unleash The Yeast: Bavarian Weizen
  • 133 - Unleash The Yeast: Belgian Trappist
  • 134 - Unleash The Yeast: Pilsen Lager
  • 135 - IPA Is Dead: Vic Secret
  • 136 - Brixton Porter
  • 137 - Prototype Challenge: Hobo Pop
  • 138 - Prototype Challenge: Interstellar
  • 139 - Prototype Challenge: Moshi Moshi 15
  • 140 - Black Eye Joe
  • 141 - Lumberjack Stout
  • 142 - Clown King
  • 143 - Hello My Name Is Vladimir
  • 144 - Bourbon Baby
  • 145 - AB:16
  • 146 - Comet
  • 147 - HBC 366 IPA
  • 148 - Kohatu
  • 149 - Hello My Name Is Zé
  • 150 - Alpha Pop
  • 151 - Jasmine IPA
  • 152 - #Mashtag 2014
  • 153 - Dog C
  • 154 - Hello My Name Is Päivi
  • 155 - Vote Sepp
  • 156 - Magic Stone Dog
  • 157 - Russian Doll: Barley Wine
  • 158 - Sub Hop
  • 159 - U-Boat
  • 160 - American Wheat
  • 161 - Cap Dog
  • 162 - Russian Doll: Double IPA
  • 163 - Russian Doll: India Pale Ale
  • 164 - Russian Doll: Pale
  • 165 - This.Is.Lager.
  • 166 - India Pale Weizen
  • 167 - AB:17
  • 168 - Konnichiwa Kitsune
  • 169 - Prototype Challenge: All Day Long
  • 170 - Prototype Challenge: Hop Fiction
  • 171 - Prototype Challenge: Vagabond Pale Ale
  • 172 - Black Eyed King Imp Vietnamese Coffee Edition
  • 173 - Shareholder Brew: Bounty
  • 174 - Restorative Beverage For Invalids And Convalescents
  • 175 - Stereo Wolf Stout
  • 176 - B-Sides: Sunshine On Rye
  • 177 - B-Sides: Bowman’s Beard
  • 178 - Hello My Name Is Little Ingrid
  • 179 - IPA Is Dead: Chinook
  • 180 - IPA Is Dead: Ella
  • 181 - IPA Is Dead: Mandarina Bavaria
  • 182 - IPA Is Dead: Pioneer
  • 183 - Born To Die
  • 184 - B-Sides: Melon And Cucumber
  • 185 - B-Sides: Sorachi Bitter
  • 186 - B-Sides: Truffle And Chocolate Stout
  • 187 - B-Sides: Hoppy Saison
  • 188 - B-Sides: Whisky Sour
  • 189 - B-Sides: Spiced Cherry Sour
  • 190 - B-Sides: Deaf Mermaid
  • 191 - #Mashtag 2015
  • 192 - Dog D
  • 193 - Hinterland
  • 194 - Peach Therapy
  • 195 - Hello My Name Is Holy Moose
  • 196 - Lizard Bride
  • 197 - B-Sides: Mango Gose
  • 198 - Candy Kaiser
  • 199 - Pumpkin King
  • 200 - B-Sides: Baby Saison
  • 201 - B-Sides: Morag's Mojito
  • 202 - B-Sides: Orange Blossom
  • 203 - Doodlebug
  • 204 - No Label
  • 205 - B-Sides: Rhubarb Saison
  • 206 - Prototype Challenge: India Session Lager
  • 207 - Prototype Challenge: Hopped-Up Brown Ale
  • 208 - Albino Squid Assassin
  • 209 - B-Sides: Berliner Weisse With Raspberries And Rhubarb
  • 210 - Arcade Nation
  • 211 - Elvis Juice
  • 212 - B-Sides: Berliner Weisse With Hunter Yuzu
  • 213 - B-Sides: Cascade, Centennial & Willamette IPA
  • 214 - B-Sides: Single Hop Enigma IPA
  • 215 - Jet Black Heart
  • 216 - Ace Of Simcoe
  • 217 - Ship Wreck
  • 218 - Monk Hammer
  • 219 - Prototype Pils 2.0
  • 220 - Blitz Series
  • 221 - Dog E
  • 222 - Barrel Aged Hinterland
  • 223 - AB:20
  • 224 - Barrel Aged Albino Squid Assassin
  • 225 - Kingpin
  • 226 - Paradox Islay
  • 227 - Ace Of Chinook
  • 228 - Mashtag 2016
  • 229 - Neon Overlord
  • 230 - Black Hammer
  • 231 - Ace Of Citra
  • 232 - Chili Hammer
  • 233 - Ace Of Equinox
  • 234 - Rye Hammer
  • 235 - BrewDog Vs Beavertown
  • 236 - Prototype Helles
  • 237 - Mango And Chili Barley Wine
  • 238 - Science IPA
  • 239 - Honey And Lemon Blitz
  • 240 - Blitz Saison
  • 241 - Hello My Name Is Ingrid 2016
  • 242 - Crew Brew
  • 243 - Gin Blitz
  • 244 - AB:21
  • 245 - Beatnik
  • 246 - Casino Rye Ale
  • 247 - Self Assembly Pope
  • 248 - Twin Atlantic
  • 249 - Hop Shot
  • 250 - Small Batch: Rye IPA
  • 251 - Small Batch: Sorachi Ace Session
  • 252 - Small Batch: Dortmunder
  • 253 - Small Batch: 90 Shilling
  • 254 - Small Batch: Kellerbier
  • 255 - Small Batch: Tripel
  • 256 - Small Batch: Vermont IPA
  • 257 - Semi Skimmed Occultist
  • 258 - Paradox Rye
  • 259 - Tropic Thunder
  • 260 - New England IPA
  • 261 - Small Batch: Nitro Breakfast Stout
  • 262 - Small Batch: Vermont IPA V2.0
  • 263 - Small Batch: Mandarina Lager
  • 264 - Small Batch: East Coast Crush
  • 265 - Pump Action Poet
  • 266 - Small Batch: Lemon Meringue Pie
  • 267 - AB:22
  • 268 - Hazy Jane
  • 269 - Small Batch: Imperial Pale Weizen
  • 270 - Blonde Export Stout
  • 271 - Small Batch: Cranachan Cream Ale
  • 272 - Small Batch: Spelt & Honey Saison
  • 273 - Prototype Double IPA
  • 274 - Prototype Black Rye IPA
  • 275 - Sidewalk Shark
  • 276 - Nine To Five Wizard
  • 277 - Prototype Blonde Ale
  • 278 - AB:23
  • 279 - Slot Machine
  • 280 - Make Earth Great Again
  • 281 - Homicidal Puppet Help Desk
  • 282 - Pina Colada Sidewalk Shark
  • 283 - AB:24
  • 284 - Hello My Name Is Helga
  • 285 - Hello My Name Is Sari
  • 286 - Hello My Name Is Aune
  • 287 - Hello My Name Is Marianne
  • 288 - Hello My Name Is Agnetha
  • 289 - Hello My Name Is Lieke
  • 290 - Hello My Name Is Niamh
  • 291 - Hello My Name Is Sofia
  • 292 - Hello My Name Is Maria
  • 293 - I Wanna Be Your Dog
  • 294 - Opaque Jake
  • 295 - Choco Libre
  • 296 - Off-Duty Alien
  • 297 - East Of Vermont
  • 298 - Declassified Demi-God
  • 299 - Raspberry Popsicle Parade
  • 300 - Indie Pale Ale
  • 301 - Small Batch: Dry-Hopped Pilsner
  • 302 - Hazy Jane Bourbon Barrel Aged
  • 303 - Hazy Jane Rye Barrel Aged
  • 304 - Karma Cloud
  • 305 - Native Son
  • 306 - AB:25
  • 307 - Kamikaze Knitting Club
  • 308 - Very Big Moose
  • 309 - Paradox Grain 2018
  • 310 - Clockwork Tangerine
  • 311 - Sonic Boom
  • 312 - Dog G
  • 313 - Mallow Mafia BrewDog Vs Amundsen
  • 314 - Manic Mango BrewDog Vs Brewski
  • 315 - Baltic Fleet BrewDog Vs Bevog
  • 316 - SOS (May Day!) BrewDog Vs Brlo
  • 317 - Al Adjore! BrewDog Vs Lapir Ata
  • 318 - Neverland BrewDog Vs Oedipus
  • 319 - Grano Giusto BrewDog Vs Birrificio Italiano
  • 320 - King Of Eights
  • 321 - Jinx Pale Ale
  • 322 - Jet Trash
  • 323 - Interstate Vienna Lager
  • 324 - Fools Gold Dortmunder Lager
  • 325 - Zipcode

License

Please see License

punkapi's People

Contributors

aliskinner avatar choas avatar dependabot[bot] avatar geordiematt avatar jambonbill avatar johnjenkman avatar mattballaviva avatar mikefrancis avatar notwaving avatar oni-zerone avatar phillc73 avatar philnash avatar sammdec avatar sashamasondecaires avatar stuartraetaylor avatar yoohahn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

punkapi's Issues

Change "twist" from a string to an object

The twist property is currently a string. However, there are numerous recipes that have multiple twist/brewhouse additions with various properties.

The twist property should be an array object similar to the hops property to support multiple additions.

In DIY Dog 2018 you can look at AB:24 as an example.

As a workaround for now they could be added under the hops as many of these additions are added during the dry hop stage or to the kettle during flame out or whirlpool.

Filter by ABV fails if the value is Float

Filtering by abv_gt with a float value breaks the search, here an example:
https://api.punkapi.com/v2/beers?abv_gt=1.2
and this is the current response:
{ "statusCode": 400, "error": "Bad Request", "message": "Invalid query params", "data": [ { "param": "abv_gt", "msg": "Must be a number greater than 0", "value": "1.2" } ] }

SRM greater than 40

Hi,

i searched online what the values mean. Would be nice to add this to the documentation.

However according to all sources i've seen the SRM value is between 1 and 40, but in the data set there are also values like 100 or even higher. For example the one with id 92 https://api.punkapi.com/v2/beers/92 .

Is this an issue or is there another reason for that?

[DB] : Updating to latest DIY Dog version

At the time of writing, BrewDog has published it's 8th revision of the DIY Dog book (which you can find here : link to DiyDog.

There are 415 recipes now and the db might need to be updated.
Speaking of which, I haven't found your method nor the sources that you used to parse their PDF file ; can you share some details about that maybe ? I would have liked to try pdf parsing myself and was really interested to see how you did it 😄 !

I believe that as long as the data format in the pdf does not change, we can have a periodic github action that updates the database every once in a while and publish the resulting artifacts (like your data json files).

Results limited to 80 per page

The API V2 documentation page says:

All parameters are optional and without them the API will just return the beers in ascending order from their ID.

You also mentioned in this issue that:

...you can return as many or as few as you like from the api...

Therefore, I did think that simply querying the base URL would return all beers. However, this:

curl https://api.punkapi.com/v2/beers

Returns only twenty five results, which seems to be the default per_page number.

Using the per_page parameter seems to max out at 80

curl https://api.punkapi.com/v2/beers?per_page=81
{"statusCode":400,"error":"Bad Request","message":"Invalid query params","data":[{"location":"query","param":"per_page","msg":"Must be a number greater than 0 and less than 80","value":"81"}]}

I've just started writing a wrapper for the API and am trying to handle the case where the user inputs no parameters.

This could also be linked to Issues #44 and #52

Adding beers

Heya Sam,

Can you let me know how to go about adding new recipes to this? I've forked the repo but I'm concerned about a couple of fields, ID for example, where does that come from?

The schema has some fields marked as required (will an empty string value satisfy that?)

Megs gave out some DIY dog recipes on the BD forum and I went to add them but got stuck immediately, lol.

What filters should the API have?

While adding recipes I'm also trying to build the API at the same time so that when the final recipe is published the API can go live as well. Therefore I need suggestions on what kind of filters you would want from this API. So far I have

  • beer_name
  • abv_gt
  • abv_lt
  • brewed_before
  • brewed_after
  • ibu_gt
  • ibu_lt
  • hops
  • malt
  • food
  • /random
  • ebc_gt
  • ebc_lt
  • yeast

If you have any suggestions just add them in so we can discuss!

XML output

Would it be possible to generate XML output? I'm trying to use JSONPath on the JSON output and having trouble selecting ancestors after filtering. Seems this is only possible in XPath but not JSONPath.

Spelling

Yeast spelling Errors:

  • Wyeast 1056 - Ameican Ale™ (#1 Buzz)
  • Wyeast 1056 - American Ale (#154 No Label)
  • Wyeast 1056 American Ale™ (#23 Storm)

name should be "Wyeast 1056 - American Ale™"

Maybe swapped gravities in some items

My knowledge about brewery is about zero and therefore I may be wrong, but it seems to me that some beers have their target gravities swapped.
According to a Wikipedia page "Beer_measurement" final gravity should be less or equal to original gravity. But the beers with ids in (28, 70, 127, 131, 193, 214, 221, 222, 223, 224, 225, 227, 228) have target gravities swapped: original is less than final.

Correct the spelling of litres

The recipe data is using the American spelling of liters for the boil_volume and volume units.

  "volume": {
    "value": 20,
    "unit": "liters"
  },
  "boil_volume": {
    "value": 25,
    "unit": "liters"
  }

It should use the international spelling for the measurement which is litres to be consistent with the other international spellings used for measurements in the current data set such as grams, kilograms and celsius.

Create a development branch

Would it be possible to add a development branch or a 3.0 branch? For example there are a couple of major schema changes required and also a fix for all IDs to bring them in line with the IDs in the book. Both of which would be a major bump. Might be a good to isolate these changes to an active development branch for a 3.0 release?

split hops and extras

hello, i've noticed a "trouble" in the ingredients. In fact hops array includes also extras, e.g. beer "Hello My Name Is Vladimir" (id: 40) contains "Blackberry Concentrate" and "Sour Cherry Puree" among different hops' names. Sometimes it could be confusing and it's not possible to count amount of hops properly (in this case, extras always make a statistical deviation). Maybe it's a good idea to split hops and extras into two separate arrays?

Fixing issues and typos in DIY DOG

Do you have any plans to fix up obvious errors in DIY DOG?

For example in 10 Heads High there are no weights against the hop additions in the boil. I've attempted to reverse engineer this to achieve the same IBUs. I'm using 40g Chinook at 60 mins, 15g Chinook at 30 mins and 15g Centennial at 30 mins. The 0 minute additions are a bit harder but you could base them off Hops Kill Nazis, which this recipe is loosely based on, ie. 62.5g each of Chinook and Centennial.

Ideally BrewDog would release a 2nd revision with these errors fixed up.

Add a way to get total number of beers

Currently it is not possible to get the total number of beers/pages from the api.Thus it is also not possible to display the index of the last page to the user. Displaying the page index is a very common thing to do when displaying a paginated list to a user.

Of course you could fetch all the beers in advance to find out the total amount. But that would lead to over-fetching data and is not an option at all (the rate limit is 1req/sec). And even then there is a possibility that a beer could be added/deleted without the client taking notice of that.

Is it possible to add some metadata to the api response that includes the total number of beers?

Something like this:

{
    metadata: {
        "page": 5,
        "per_page": 20,
        "page_count": 27,
        "total_count": 521,
    },
    records: [
        ...
    ],
}

Guide for Contributing

The newest DIY Dog publication, now v8, lists 415 individual recipes. The API data currently only contains 325.

I'm interested in contributing newer recipes, but do not know how.

While it's straightforward enough to produce the necessary JSON file containing the new recipe data, there's no instructions regarding how to make a pull request containing the necessary image for the image_url.

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.