Skip to content

richardpiazza/MiseEnPlace

MiseEnPlace

A framework for converting and interpreting common measurements used in cooking.

Usage

Protocols

The framework consists of several protocols that define specific types and behaviors.

Component Protocols:

  • Descriptive: Properties that describe and categorize an element.
  • Multimedia: Protocol for interactive with element images.
  • Proportioned: Parameters that indicate a volume-to-weight ratio.
  • Quantifiable: Parameters that indicate a 'measurement'.
  • Sequenced: Properties that describe the order of elements.
  • Unique: The properties needed to determine uniqueness of elements.

Collective Protocols:

Enumerations

Ingredient Ratios

Understanding the volume-to-weight ratio of Ingredients is the key to scaling and transforming acurately. Water, for instance, has a 1:1 ratio, meaning that 1 Ounce (or gram) is equal to 1 Fluid Ounce (or milliliter). Whereas All Purpose (Plain) Flour takes up more volume than it weighs; a ratio of 1.882:1.

This ratio allows for the transofmration of any measurement of an ingredient into another system. Tablespoons, Cups, and Pounds can be converted into Grams or Milliliters (or the other way around).

Scaling Formulas

A formula is the collection of measured Ingredients (or other Recipes) for a specific Recipe. A simple Italian Bread has the formula:

  • 1.8 kg AP/Plain Flour
  • 28 g Active Dry Yeast
  • 28 g Salt
  • 955 mL Water

The elements about can produce 1 large loaf or two small loaves weighing a total of 702.5 Grams. But, what if you wanted 5 small loaves? This is where scaling a Recipe comes in.

let recipe: Recipe
let scaledFormula: [FormulaElement] = recipe.scale(by: 2.5)
// 4.5 kg Flour
// 70 g Yeast
// 70 g Salt
// 2388 mL Water

Installation

MiseEnPlace is distributed using the Swift Package Manager. To install it into a project, add it as a dependency within your Package.swift manifest, or through Xcode:

let package = Package(
    
    dependencies: [
        .package(url: "https://github.com/richardpiazza/MiseEnPlace.git", .upToNextMajor(from: "6.0.0"))
    ],
    
)

Then import MiseEnPlace wherever you'd like to use it:

import MiseEnPlace

About

A swift framework for converting and interpreting common measurements used in cooking.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages