Utility functions for CoffeeTrove cafe data and coffee calculations. Provides Golden Drop scoring, brew ratio computation, cafe URL building, and a registry of coffee origins with flavor profiles.
Utility functions for CoffeeTrove cafe data and coffee calculations. Provides Golden Drop scoring, brew ratio computation, cafe URL building, and a registry of coffee origins with flavor profiles.
(brew-ratio dose-grams ratio-water)Calculate water needed for a given coffee dose and target ratio. Standard ratios: 1:15 for pour-over, 1:2 for espresso, 1:17 for drip. Returns a map with dose, ratio, and water amounts.
(brew-ratio 18 15) ;; => {:dose-g 18, :ratio "1:15", :water-ml 270.0}
Calculate water needed for a given coffee dose and target ratio.
Standard ratios: 1:15 for pour-over, 1:2 for espresso, 1:17 for drip.
Returns a map with dose, ratio, and water amounts.
(brew-ratio 18 15)
;; => {:dose-g 18, :ratio "1:15", :water-ml 270.0}(cafe-url city-slug cafe-slug)Build a CoffeeTrove cafe detail URL from city and cafe slugs.
(cafe-url "paris" "cafe-de-flore") ;; => "/cafe/paris/cafe-de-flore"
Build a CoffeeTrove cafe detail URL from city and cafe slugs. (cafe-url "paris" "cafe-de-flore") ;; => "/cafe/paris/cafe-de-flore"
(golden-drop-score cafe-data)Calculate a Golden Drop score (0-65) for a cafe based on data completeness. Takes a map of boolean flags indicating which data fields are present. Independent cafes receive a bonus.
(golden-drop-score {:has-hours true :has-phone true :has-website false :has-photos true :has-rating true :has-address true :independent true}) ;; => 57
Calculate a Golden Drop score (0-65) for a cafe based on data completeness.
Takes a map of boolean flags indicating which data fields are present.
Independent cafes receive a bonus.
(golden-drop-score {:has-hours true :has-phone true :has-website false
:has-photos true :has-rating true :has-address true
:independent true})
;; => 57Map of coffee origins with country, region, and tasting notes.
Map of coffee origins with country, region, and tasting notes.
(origins-by-region)Group coffee origins by their growing region. Returns a map of region names to vectors of origin keywords.
(origins-by-region) ;; => {"Africa" [:ethiopia :kenya], "South America" [:colombia :brazil], ...}
Group coffee origins by their growing region.
Returns a map of region names to vectors of origin keywords.
(origins-by-region)
;; => {"Africa" [:ethiopia :kenya], "South America" [:colombia :brazil], ...}Weights for each data completeness field in Golden Drop score calculation.
Weights for each data completeness field in Golden Drop score calculation.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |