#!/usr/bin/env python3
"""Yield estimates for wiki entity enrichment.

Based on typical heirloom variety yields per plant/sq ft.
Sources: Burpee, Baker Creek, Seed Savers Exchange, university extension.
"""
from pathlib import Path

# Yield data: slug -> {per_plant, per_sq_ft, season_total}
YIELD_DATA = {
    # Fruiting vegetables
    "dark-green-zucchini-squash": {
        "per_plant": "4-8 lbs per plant",
        "season": "Summer through first frost",
        "notes": "One plant feeds 3-4 people",
    },
    "jack-o-lantern-pumpkin": {
        "per_plant": "2-4 pumpkins per plant (10-40 lbs each)",
        "season": "Late summer through fall",
        "notes": "Allow 10x10 ft spacing for full-sized pumpkins",
    },
    "pickling-cucumber": {
        "per_plant": "8-12 lbs per plant",
        "season": "Mid-summer through fall",
        "notes": "Pick every 1-2 days for best flavor",
    },
    "crimson-sweet-watermelon": {
        "per_plant": "2-3 melons per plant (15-25 lbs each)",
        "season": "Late summer",
        "notes": "Needs hot soil and long season",
    },
    "luffa-sponge-gourd": {
        "per_plant": "8-12 gourds per plant",
        "season": "Mid-summer through fall",
        "notes": "Harvest green for vegetables, cure for sponges",
    },
    "roma-tomatoes": {
        "per_plant": "10-15 lbs per plant",
        "season": "Mid-summer through fall",
        "notes": "High yield for paste tomato, excellent for sauce",
    },
    "california-wonder-sweet-pepper": {
        "per_plant": "2-4 lbs per plant",
        "season": "Mid-summer through fall",
        "notes": "Peppers continue producing until frost",
    },
    "jalapeno-peppers": {
        "per_plant": "1-3 lbs per plant",
        "season": "Mid-summer through fall",
        "notes": "Harvest green or allow to ripen red for more heat",
    },
    
    # Legumes
    "provider-green-bush-beans": {
        "per_plant": "0.5-1 lb per plant",
        "season": "Mid-summer, 1-2 week harvest window",
        "notes": "Succession plant for continuous harvest",
    },
    "sugar-lace-snap-peas": {
        "per_plant": "1-2 lbs per plant",
        "season": "Spring and fall",
        "notes": "Cool season crop, edible pods and seeds",
    },
    
    # Brassicas
    "long-island-brussels-sprouts": {
        "per_plant": "1-2 lbs per plant (20-40 sprouts)",
        "season": "Late fall through early winter",
        "notes": "Sweetens after first frost",
    },
    "snowball-turnips": {
        "per_plant": "0.5-1 lb per plant",
        "season": "Early fall or spring",
        "notes": "Also harvest greens for eating",
    },
    
    # Root vegetables
    "sugar-beets": {
        "per_plant": "0.5-1 lb per plant",
        "season": "Early fall",
        "notes": "Harvest at 2-3\" diameter for best sweetness",
    },
    "bulls-blood-beets": {
        "per_plant": "0.5-1 lb per plant",
        "season": "Early fall",
        "notes": "Same yield as sugar beets, deep red color",
    },
    "scarlett-nantes-carrot": {
        "per_plant": "0.5-1 lb per plant",
        "season": "Early fall",
        "notes": "Harvest at 2-3\" diameter, sweet and crunchy",
    },
    
    # Leafy greens
    "butter-crunch-butterhead-lettuce": {
        "per_plant": "1 head per plant",
        "season": "Spring and fall",
        "notes": "Cut-and-come-again harvest, 3-4 cuts per plant",
    },
    "red-russian-kale": {
        "per_plant": "1-2 lbs per plant",
        "season": "Fall through winter",
        "notes": "Harvest outer leaves, continues producing",
    },
    "utah-celery": {
        "per_plant": "1-2 lbs per plant",
        "season": "Late summer through fall",
        "notes": "Slow growing, needs consistent moisture",
    },
    "white-bunching-onion": {
        "per_plant": "0.5-1 lb per bunch",
        "season": "Mid-summer",
        "notes": "Harvest as bunching onions or let bulbs form",
    },
    
    # Herbs
    "large-leaf-basil": {
        "per_plant": "0.5-1 lb per plant",
        "season": "Summer through fall",
        "notes": "Pinch flowers for continuous harvest",
    },
    "parsley": {
        "per_plant": "0.5-1 lb per plant",
        "season": "Cool seasons, biennial",
        "notes": "Two-year crop, harvest leaves throughout",
    },
    "coriander-cilantro": {
        "per_plant": "0.25-0.5 lb per plant",
        "season": "Spring and fall",
        "notes": "Quick bolting in heat, succession plant",
    },
    "catnip-herb": {
        "per_plant": "Perennial, self-seeds freely",
        "season": "All growing season",
        "notes": "One plant spreads to fill area",
    },
    
    # Zea mays
    "yellow-dent-corn": {
        "per_plant": "1-2 ears per plant",
        "season": "Late summer",
        "notes": "Plant in blocks for wind pollination",
    },
}


def build_yield_section(data):
    """Build Yield section text."""
    lines = [
        "## Yield",
        f"- **Per Plant:** {data['per_plant']}",
        f"- **Harvest Season:** {data['season']}",
    ]
    if data.get('notes'):
        lines.append(f"- **Note:** {data['notes']}")
    return "\n".join(lines) + "\n"


if __name__ == "__main__":
    print(f"Yield data for {len(YIELD_DATA)} varieties")
    for slug, data in sorted(YIELD_DATA.items()):
        print(f"  {slug}: {data['per_plant']}")