def METHOD_NAME() -> Response:
    """Get download stats in CSV format."""
    csv_head = "month,downloads\n"
    try:
        csv_data = "".join(
            [
                f"{r.ym.strftime('%Y-%m')},{r.downloads}\n"
                for r in get_monthly_download_stats()
            ]
        )
        return (
            {"csv": csv_head + csv_data},
            status.HTTP_200_OK,
            {"Content-Type": "text/csv"},
        )
    except Exception as ex:
        logger.warning(f"Error getting monthly download stats csv: {ex}")
        raise InternalServerError from ex