DEV Community

Jeremy Libeskind
Jeremy Libeskind

Posted on

Modernizing Vitrerie

Modernizing Vitrerie: Building a Glass Quoting Calculator in Python

Vitrerie is the French term for the specialized trade of glazing — cutting, fitting, installing, and repairing glass in windows, doors, shower enclosures, storefronts, curtain walls, mirrors, and more.

It’s a precise, physical craft that has existed for centuries, yet many small vitrerie businesses still rely on manual spreadsheets or pen-and-paper calculations for customer quotes. That’s where a developer can make a real impact.

In this article, I’ll walk you through a practical Python tool that automates glass quoting — something any glazier (vitrier) can use daily. It’s a perfect example of how simple code can modernize traditional trades.

What Exactly Is Vitrerie?

Vitrerie involves:

  • Measuring and cutting flat glass to exact dimensions
  • Working with many glass types (clear float, tempered safety glass, laminated, low-E, frosted, etc.)
  • Installing and sealing panels using structural silicones, setting blocks, and weatherproofing
  • Complying with strict building codes and safety standards

Small vitrerie shops often lose time (and money) recalculating quotes manually. Automation fixes that instantly.

Why Automation Matters for Glaziers

  • Speed: Respond to customers in minutes instead of hours
  • Accuracy: No more math errors on area, waste factor, or pricing
  • Professionalism: Clean, consistent quotes every time
  • Scalability: Easy to handle more jobs without hiring extra office staff

Let’s Build the Tool: A Vitrerie Quote Calculator

Here’s a clean, ready-to-use Python script. It calculates area, applies different pricing per glass type, adds labor, includes a realistic waste/profit margin, and returns a professional quote.


python
def calculate_glass_area(width_mm: float, height_mm: float) -> float:
    """Convert mm dimensions to square meters (standard pricing unit)"""
    return (width_mm * height_mm) / 1_000_000

def get_glass_price_per_m2(glass_type: str) -> float:
    """Realistic example prices per m² (USD) – adjust to your local supplier rates"""
    prices = {
        "clear": 48.0,      # Standard float glass
        "tempered": 88.0,   # Heat-treated safety glass
        "laminated": 115.0, # PVB interlayer for security/sound control
        "low_e": 98.0,      # Energy-efficient low-emissivity coating
        "frosted": 78.0,    # Privacy / decorative glass
    }
    return prices.get(glass_type.lower(), 55.0)

def generate_quote(
    num_panels: int,
    width_mm: float,
    height_mm: float,
    glass_type: str,
    labor_per_panel: float = 38.0,
    waste_margin: float = 1.15
) -> dict:

    area_per_panel = calculate_glass_area(width_mm, height_mm)
    total_area = area_per_panel * num_panels

    price_per_m2 = get_glass_price_per_m2(glass_type)

    glass_cost = total_area * price_per_m2
    labor_cost = num_panels * labor_per_panel
    subtotal = glass_cost + labor_cost

    # Add 15% for waste, transport, breakage risk & profit margin
    final_price = subtotal * waste_margin

    return {
        "total_area_m2": round(total_area, 3),
        "glass_cost": round(glass_cost, 2),
        "labor_cost": round(labor_cost, 2),
        "final_price": round(final_price, 2),
        "glass_type": glass_type.title()
    }

# Example usage – just change the values for any job
if __name__ == "__main__":
    quote = generate_quote(
        num_panels=4,
        width_mm=1500,
        height_mm=2200,
        glass_type="tempered",
        labor_per_panel=42.0
    )

    print("═" * 40)
    print("          VITRERIE QUOTE")
    print("═" * 40)
    print(f"Glass Type     : {quote['glass_type']}")
    print(f"Total Area     : {quote['total_area_m2']} m²")
    print(f"Glass Cost     : ${quote['glass_cost']}")
    print(f"Labor Cost     : ${quote['labor_cost']}")
    print(f"**TOTAL QUOTE  : ${quote['final_price']}**")
    print("═" * 40)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)