Data with Babish
This project aims to analyze the recipes of the popular YouTube channel Binging with Babish and convert them into beautiful data.
Visualizations
- jklewa.github.io/data-with-babish-example (repo) An interactive episode data viewer
Datasets
- ibdb.episodes.json (docs) Episodes and related guests, recipes and inspiration
- ibdb.guests.json (docs) Guests and their appearances
- ibdb.recipes.json (docs) Recipes and their origin episode
- ibdb.references.json (docs) TV Shows, Movies, etc. and when they were referenced
- ibdb.shows.json (docs) Babish's Shows and their episode lists
- babish.json (docs) Parsed recipe ingredients, grouped by episode (Deprecated)
ibdb.episodes.json
Episodes and 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.json
Guests and 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.json
Recipes and 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.json
TV Shows, Movies, etc. References and 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.json
Babish's Shows and 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 from BWB Recipes in 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
],
# ...
]
},
# ...
]
},
# ...
]
Resources
- Regex Samples: https://regexr.com/3p7h8 https://regexr.com/3p6pq
- Handling Unicode Fractions: https://stackoverflow.com/questions/1263796/how-do-i-convert-unicode-characters-to-floats-in-python
Contributing
Local Development
Required tools: Docker, Docker Compose
- Build
docker-compose build - Run DB and API
docker-compose up -d - Browse http://localhost:5000/
- Update DB and datasets
docker-compose exec ibdb sync update export - See other commands
docker-compose exec ibdb --help
This will use populate_db.py to scrape and upsert episodes into the DB and export.py to generate new datasets/ from the DB's contents.
You can also explore the original populate_babish_json.py and Jupyter Notebooks
cd notebooks/- Start Jupyter on http://localhost:8888
jupyter notebook - Open
Babish Recipe Extract.ipynborBabish Data Analysis.ipynb
NOTE: Be aware that Babish Recipe Extract.ipynb will make LOTS of 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.
Tests
Tests covering recipe_parser.py are located in the tests/ directory and can be run using pytest.
Required tools: Python 3.8
- Install packages
pip install -r requirements.txt - Run tests
python -m pytest
Docs
Metadata
Release files for babish-db 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| babish-db-0.0.1.tar.gz | 18.5 kB | Without provenance | Details for babish-db-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| babish_db-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for babish_db-0.0.1-py3-none-any.whl |
Total release size: 60.2 kB
Release files / babish-db-0.0.1.tar.gz
| Download URL | babish-db-0.0.1.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5221ff8b4ab40380c0cb89761d2fd51eadb369770b2d666ab413f2d82738196d
|
|
BLAKE2b-256 checksum How to use checksums |
05f5239fed2d606bf496d2639cd93295a1177518990c89d1ca5dcd21b3d206ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6
|
Release files / babish_db-0.0.1-py3-none-any.whl
| Download URL | babish_db-0.0.1-py3-none-any.whl |
|---|---|
| Size | 41.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a30f016af3d2d5caacddac1eeb1f7fa1887fc1c39f3bd67f66ba19689046bdd
|
|
BLAKE2b-256 checksum How to use checksums |
ad01e58e1771a91fc6824e050d679fe547019912f6dda43855eac7d3b36a4b60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6
|
Security for babish-db 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.