Add WhiskyDB tab to sample explorers
Browse files
README.md
CHANGED
|
@@ -12,10 +12,11 @@ license: cc-by-nc-4.0
|
|
| 12 |
|
| 13 |
# ποΈ Dataset Sample Explorers
|
| 14 |
|
| 15 |
-
One interactive explorer for the **free samples** of
|
| 16 |
|
| 17 |
* **β [RoasterDB](https://specialty-coffee-roasterdb.pages.dev)** β specialty coffee mapped to the SCA Flavor Wheel ([sample dataset](https://huggingface.co/datasets/Ichlibitiche/roasterdb-specialty-coffee-sample))
|
| 18 |
* **πΏ [FloraDB](https://houseplants-botanical-floradb.pages.dev)** β quantitative houseplant care + ASPCA pet toxicity ([sample dataset](https://huggingface.co/datasets/Ichlibitiche/floradb-houseplants-care-sample))
|
| 19 |
* **π [SuppDB](https://supplements-nootropics-suppdb.pages.dev)** β NIH DSLD supplement labels with mg-normalized doses + PubChem chemistry ([sample dataset](https://huggingface.co/datasets/Ichlibitiche/suppdb-supplements-sample))
|
|
|
|
| 20 |
|
| 21 |
Every record carries a source URL for re-verification. Full datasets are commercially licensed at each portal. Sample data CC BY-NC 4.0.
|
|
|
|
| 12 |
|
| 13 |
# ποΈ Dataset Sample Explorers
|
| 14 |
|
| 15 |
+
One interactive explorer for the **free samples** of four curated commercial datasets:
|
| 16 |
|
| 17 |
* **β [RoasterDB](https://specialty-coffee-roasterdb.pages.dev)** β specialty coffee mapped to the SCA Flavor Wheel ([sample dataset](https://huggingface.co/datasets/Ichlibitiche/roasterdb-specialty-coffee-sample))
|
| 18 |
* **πΏ [FloraDB](https://houseplants-botanical-floradb.pages.dev)** β quantitative houseplant care + ASPCA pet toxicity ([sample dataset](https://huggingface.co/datasets/Ichlibitiche/floradb-houseplants-care-sample))
|
| 19 |
* **π [SuppDB](https://supplements-nootropics-suppdb.pages.dev)** β NIH DSLD supplement labels with mg-normalized doses + PubChem chemistry ([sample dataset](https://huggingface.co/datasets/Ichlibitiche/suppdb-supplements-sample))
|
| 20 |
+
* **π₯ [WhiskyDB](https://github.com/WhiskyyDB/whisky-database)** β provenance-tracked fine spirits + open cask & flavor taxonomies ([sample dataset](https://huggingface.co/datasets/Ichlibitiche/whiskydb-fine-spirits-sample))
|
| 21 |
|
| 22 |
Every record carries a source URL for re-verification. Full datasets are commercially licensed at each portal. Sample data CC BY-NC 4.0.
|
app.py
CHANGED
|
@@ -6,9 +6,15 @@ ROASTER_URL = "hf://datasets/Ichlibitiche/roasterdb-specialty-coffee-sample/roas
|
|
| 6 |
FLORA_URL = "hf://datasets/Ichlibitiche/floradb-houseplants-care-sample/floradb_sample.csv"
|
| 7 |
SUPP_URL = "hf://datasets/Ichlibitiche/suppdb-supplements-sample/suppdb_sample.csv"
|
| 8 |
|
|
|
|
|
|
|
| 9 |
r_df = pd.read_csv(ROASTER_URL)
|
| 10 |
f_df = pd.read_csv(FLORA_URL)
|
| 11 |
s_df = pd.read_csv(SUPP_URL)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
def choices(df, col):
|
|
@@ -156,10 +162,34 @@ def s_explore(ingredient_query, brand, category, form, blend_filter):
|
|
| 156 |
return summary, d[list(S_COLS)].rename(columns=S_COLS)
|
| 157 |
|
| 158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
# ββ UI ββ
|
| 160 |
with gr.Blocks(title="Dataset Sample Explorers") as demo:
|
| 161 |
gr.Markdown("# ποΈ Dataset Sample Explorers")
|
| 162 |
-
gr.Markdown("""Interactive explorers for the **free samples** of
|
| 163 |
|
| 164 |
with gr.Tab("β RoasterDB β Specialty Coffee"):
|
| 165 |
gr.Markdown(f"""**{len(r_df)} verified coffees from {r_df['source_roaster'].nunique()} artisan roasters**, tasting notes normalized to the **SCA Flavor Wheel**. Full dataset: **8,000+ products, 280+ roasters** β [roasterdb.net](https://specialty-coffee-roasterdb.pages.dev) Β· [π€ sample dataset](https://huggingface.co/datasets/Ichlibitiche/roasterdb-specialty-coffee-sample) Β· [π Kaggle](https://www.kaggle.com/datasets/ahtiticheamine/roasterdb-specialty-coffee-sample) Β· [π Apify scraper](https://apify.com/dataengineered/specialty-coffee-roaster-scraper)""")
|
|
@@ -210,7 +240,25 @@ with gr.Blocks(title="Dataset Sample Explorers") as demo:
|
|
| 210 |
s_btn.click(fn=s_explore, inputs=s_inputs, outputs=[s_text, s_table])
|
| 211 |
demo.load(fn=s_explore, inputs=s_inputs, outputs=[s_text, s_table])
|
| 212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
gr.Markdown("""---
|
| 214 |
-
*Sample data CC BY-NC 4.0 (per-dataset attribution on each tab). FloraDB toxicity data is informational, not veterinary advice; SuppDB is factual label data, not medical advice. Full datasets commercially licensed at each portal. Sister project: [π¬ INCIDB Skincare Dupe Finder](https://huggingface.co/spaces/Ichlibitiche/incidb-skincare-dupe-finder).*""")
|
| 215 |
|
| 216 |
demo.launch()
|
|
|
|
| 6 |
FLORA_URL = "hf://datasets/Ichlibitiche/floradb-houseplants-care-sample/floradb_sample.csv"
|
| 7 |
SUPP_URL = "hf://datasets/Ichlibitiche/suppdb-supplements-sample/suppdb_sample.csv"
|
| 8 |
|
| 9 |
+
WHISKY_BASE = "hf://datasets/Ichlibitiche/whiskydb-fine-spirits-sample/"
|
| 10 |
+
|
| 11 |
r_df = pd.read_csv(ROASTER_URL)
|
| 12 |
f_df = pd.read_csv(FLORA_URL)
|
| 13 |
s_df = pd.read_csv(SUPP_URL)
|
| 14 |
+
w_df = pd.read_csv(WHISKY_BASE + "spirits.csv")
|
| 15 |
+
w_dist_df = pd.read_csv(WHISKY_BASE + "distilleries.csv")
|
| 16 |
+
w_casks_df = pd.read_csv(WHISKY_BASE + "casks_taxonomy.csv")
|
| 17 |
+
w_flavors_df = pd.read_csv(WHISKY_BASE + "flavors_taxonomy.csv")
|
| 18 |
|
| 19 |
|
| 20 |
def choices(df, col):
|
|
|
|
| 162 |
return summary, d[list(S_COLS)].rename(columns=S_COLS)
|
| 163 |
|
| 164 |
|
| 165 |
+
# ββ WhiskyDB ββ
|
| 166 |
+
W_COLS = {
|
| 167 |
+
"name": "Spirit",
|
| 168 |
+
"type": "Type",
|
| 169 |
+
"age": "Age (years)",
|
| 170 |
+
"abv": "ABV %",
|
| 171 |
+
"volume_ml": "Volume (ml)",
|
| 172 |
+
"source_name": "Source",
|
| 173 |
+
"source_url": "Source URL",
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
def w_explore(query, spirit_type):
|
| 177 |
+
d = w_df
|
| 178 |
+
if query and query.strip():
|
| 179 |
+
d = d[d["name"].fillna("").str.contains(query.strip(), case=False, regex=False)]
|
| 180 |
+
if spirit_type != "All":
|
| 181 |
+
d = d[d["type"] == spirit_type]
|
| 182 |
+
summary = (
|
| 183 |
+
f"**{len(d)} spirits** match β out of {len(w_df)} in the free sample. "
|
| 184 |
+
f"The full WhiskyDB has **1,290+ spirits, 3,200+ distilleries & 20,000+ monthly auction-price benchmarks (2005 β today)**."
|
| 185 |
+
)
|
| 186 |
+
return summary, d[list(W_COLS)].rename(columns=W_COLS)
|
| 187 |
+
|
| 188 |
+
|
| 189 |
# ββ UI ββ
|
| 190 |
with gr.Blocks(title="Dataset Sample Explorers") as demo:
|
| 191 |
gr.Markdown("# ποΈ Dataset Sample Explorers")
|
| 192 |
+
gr.Markdown("""Interactive explorers for the **free samples** of four curated commercial datasets. Every record carries a source URL so any fact can be re-verified. Full datasets are available at each official portal.""")
|
| 193 |
|
| 194 |
with gr.Tab("β RoasterDB β Specialty Coffee"):
|
| 195 |
gr.Markdown(f"""**{len(r_df)} verified coffees from {r_df['source_roaster'].nunique()} artisan roasters**, tasting notes normalized to the **SCA Flavor Wheel**. Full dataset: **8,000+ products, 280+ roasters** β [roasterdb.net](https://specialty-coffee-roasterdb.pages.dev) Β· [π€ sample dataset](https://huggingface.co/datasets/Ichlibitiche/roasterdb-specialty-coffee-sample) Β· [π Kaggle](https://www.kaggle.com/datasets/ahtiticheamine/roasterdb-specialty-coffee-sample) Β· [π Apify scraper](https://apify.com/dataengineered/specialty-coffee-roaster-scraper)""")
|
|
|
|
| 240 |
s_btn.click(fn=s_explore, inputs=s_inputs, outputs=[s_text, s_table])
|
| 241 |
demo.load(fn=s_explore, inputs=s_inputs, outputs=[s_text, s_table])
|
| 242 |
|
| 243 |
+
with gr.Tab("π₯ WhiskyDB β Fine Spirits"):
|
| 244 |
+
gr.Markdown(f"""**{len(w_df)} spirits + {len(w_dist_df)} distilleries**, provenance-tracked from open public sources, with **fully open cask & flavor taxonomies** (CC BY 4.0). Full dataset: **1,290+ spirits, 3,200+ distilleries, 20,000+ monthly auction-price benchmarks (Nov 2005 β today)** β [π€ sample dataset](https://huggingface.co/datasets/Ichlibitiche/whiskydb-fine-spirits-sample) Β· [π GitHub](https://github.com/WhiskyyDB/whisky-database) Β· [π§ get the full dataset](mailto:whiskeydn.kite979@simplelogin.com)""")
|
| 245 |
+
with gr.Row():
|
| 246 |
+
w_query = gr.Textbox(label="Spirit Search", placeholder="e.g. Lagavulin, Eagle Rare, Yamazaki...")
|
| 247 |
+
w_type = gr.Dropdown(choices=choices(w_df, "type"), value="All", label="Spirit Type")
|
| 248 |
+
w_btn = gr.Button("Explore Spirits", variant="primary")
|
| 249 |
+
w_text = gr.Markdown()
|
| 250 |
+
w_table = gr.Dataframe(label="Matching Spirits", wrap=True)
|
| 251 |
+
w_inputs = [w_query, w_type]
|
| 252 |
+
w_btn.click(fn=w_explore, inputs=w_inputs, outputs=[w_text, w_table])
|
| 253 |
+
demo.load(fn=w_explore, inputs=w_inputs, outputs=[w_text, w_table])
|
| 254 |
+
with gr.Accordion(f"π Sample Distilleries ({len(w_dist_df)})", open=False):
|
| 255 |
+
gr.Dataframe(value=w_dist_df.rename(columns={"name": "Distillery", "country": "Country", "region": "Region", "source_url": "Source URL"})[["Distillery", "Country", "Region", "Source URL"]], wrap=True)
|
| 256 |
+
with gr.Accordion(f"π’οΈ Open Cask Taxonomy ({len(w_casks_df)} styles, CC BY 4.0)", open=False):
|
| 257 |
+
gr.Dataframe(value=w_casks_df, wrap=True)
|
| 258 |
+
with gr.Accordion(f"π Open Flavor Taxonomy ({len(w_flavors_df)} descriptors, CC BY 4.0)", open=False):
|
| 259 |
+
gr.Dataframe(value=w_flavors_df, wrap=True)
|
| 260 |
+
|
| 261 |
gr.Markdown("""---
|
| 262 |
+
*Sample data CC BY-NC 4.0 (per-dataset attribution on each tab); WhiskyDB taxonomies CC BY 4.0. FloraDB toxicity data is informational, not veterinary advice; SuppDB is factual label data, not medical advice. Full datasets commercially licensed at each portal. Sister project: [π¬ INCIDB Skincare Dupe Finder](https://huggingface.co/spaces/Ichlibitiche/incidb-skincare-dupe-finder).*""")
|
| 263 |
|
| 264 |
demo.launch()
|