from astrology import calculate_planets

def get_single_planet(data, planet_name: str):
    result = calculate_planets(**data)

    planet_name = planet_name.lower()

    if planet_name not in result["planets"]:
        return {"error": "Invalid planet name"}

    planet = result["planets"][planet_name]

    return {
        "planet": planet_name,
        "sign": planet["sign"],
        "degree": planet["degree"],
        "house": planet["house"]
    }
