Package: babish-db
Data with BabishThis project aims to analyze the recipes of the popular YouTube channelBinging with Babishand convert them into beautiful data.Visualizationsjklewa.github.io/data-with-babish-example(repo) An interactive episode data viewerDatasetsibdb.episodes.json(docs) Episodes and related guests, recipes and inspirationibdb.guests.json(docs) Guests and their appearancesibdb.recipes.json(docs) Recipes and their origin episodeibdb.references.json(docs) TV Shows, Movies, etc. and when they were referencedibdb.shows.json(docs) Babish's Shows and their episode listsbabish.json(docs) Parsed recipe ingredients, grouped by episode (Deprecated)ibdb.episodes.jsonEpisodesand related guests, recipes and inspiration in the format:[{"episode_id":"epid","name":"Episode Name","published_date":"YYYY-MM-DD","youtube_link":"https://www.youtube.com/watch?v=...","official_link":"https://www.bingingwithbabish.com/recipes/...","image_link":"https://preview.image.host/image.png","related":{"show":{"show_id":1,"name":"Binging with Babish"},"guests":[{"guest_id":1,"name":"Guest Name"}],"inspired_by":[{"reference_id":1,"type":"tv_show|movie|youtube_channel|video_game|other","name":"Reference Name","description":"A description of the reference.","external_link":"https://link.to.more/"}],"recipes":[{"recipe_id":1,"name":"Recipe Name","raw_ingredient_list":"Ingedient 1\nIngredient 2\n...","raw_procedure":"Step 1.\nStep 2.\n...","ingredient_list":[[1.0,# quantity"tablespoon",# unit"Butter",# name"1 tablespoon butter"# raw text from recipe],# ...]}]}},# ...]ibdb.guests.jsonGuestsand their appearances in the format:[{"guest_id":1,"name":"Guest Name","appearances":[{"episode_id":"epid","name":"Episode Name","published_date":"YYYY-MM-DD","youtube_link":"https://www.youtube.com/watch?v=...","official_link":"https://www.bingingwithbabish.com/recipes/...","image_link":"https://preview.image.host/image.png"}]},# ...]ibdb.recipes.jsonRecipesand their origin episode in the format:[{"recipe_id":1,"name":"Recipe Name","raw_ingredient_list":"Ingedient 1\nIngredient 2\n...","raw_procedure":"Step 1.\nStep 2.\n...","source":{"episode_id":"epid","name":"Episode Name","published_date":"YYYY-MM-DD","youtube_link":"https://www.youtube.com/watch?v=...","official_link":"https://www.bingingwithbabish.com/recipes/...","image_link":"https://preview.image.host/image.png"},"ingredient_list":[[1.0,# quantity"tablespoon",# unit"Butter",# name"1 tablespoon butter"# raw text from recipe],# ...]},# ...]ibdb.references.jsonTV Shows, Movies, etc.Referencesand when they were referenced in the format:[{"reference_id":1,"type":"tv_show|movie|youtube_channel|video_game|other","name":"Reference Name","description":"A description of the reference.","external_link":"https://link.to.more/","episodes_inspired":[{"episode_id":"epid","name":"Episode Name","published_date":"YYYY-MM-DD","youtube_link":"https://www.youtube.com/watch?v=...","official_link":"https://www.bingingwithbabish.com/recipes/...","image_link":"https://preview.image.host/image.png"}]},# ...]ibdb.shows.jsonBabish's Showsand their episode lists in the format:[{"show_id":1,"name":"Binging with Babish","episodes":[{"episode_id":"epid","name":"Episode Name","published_date":"YYYY-MM-DD","youtube_link":"https://www.youtube.com/watch?v=...","official_link":"https://www.bingingwithbabish.com/recipes/...","image_link":"https://preview.image.host/image.png"}]},# ...]babish.json(Deprecated)Contains ingredients fromBWB Recipesin the format:[{"episode_name":"Episode Name","episode_link":"https://www.bingingwithbabish.com/recipes/...","youtube_link":"https://www.youtube.com/watch?v=...","published":"YYYY-MM-DD","recipes":[{"method":"Method Name (from Episode Name)","ingredients":[[1.0,# quantity"tablespoon",# unit"Butter",# name"1 tablespoon butter"# raw text from recipe],# ...]},# ...]},# ...]ResourcesRegex Samples:https://regexr.com/3p7h8https://regexr.com/3p6pqHandling Unicode Fractions:https://stackoverflow.com/questions/1263796/how-do-i-convert-unicode-characters-to-floats-in-pythonContributingLocal DevelopmentRequired tools:Docker, Docker ComposeBuilddocker-compose buildRun DB and APIdocker-compose up -dBrowsehttp://localhost:5000/Update DB and datasetsdocker-compose exec ibdb sync update exportSee other commandsdocker-compose exec ibdb --helpThis will usepopulate_db.pyto scrape and upsert episodes into the DB andexport.pyto generate newdatasets/from the DB's contents.You can also explore the originalpopulate_babish_json.pyandJupyter Notebookscd notebooks/Start Jupyter onhttp://localhost:8888jupyter notebookOpenBabish Recipe Extract.ipynborBabish Data Analysis.ipynbNOTE:Be aware thatBabish Recipe Extract.ipynbwill makeLOTSof network calls to the official bingingwithbabish.com website. Calls are cached and rate limited but please be very considerate and only run them if absolutely necessary.TestsTests coveringrecipe_parser.pyare located in thetests/directory and can be run usingpytest.Required tools:Python 3.8Install packagespip install -r requirements.txtRun testspython -m pytestDocsCode of Conduct,GNU General Public License v3.0