Update code in endpoints/liverpool.get.py

This commit is contained in:
Backend IM Bot 2025-03-25 05:38:52 +00:00
parent 4449917a0a
commit 37a4fa330f

View File

@ -0,0 +1,46 @@
from fastapi import APIRouter
import random
musicians = [
{
"name": "Sinach",
"hits": ["Way Maker", "I Know Who I Am", "Great Are You Lord"],
"years_active": "2002-present"
},
{
"name": "Nathaniel Bassey",
"hits": ["Imela", "Onise Iyanu", "Olowogbogboro"],
"years_active": "2008-present"
},
{
"name": "Mercy Chinwo",
"hits": ["Excess Love", "Chinedum", "Onyedikagi"],
"years_active": "2012-present"
},
{
"name": "Frank Edwards",
"hits": ["Mma Mma", "You Too Dey Bless Me", "If God Be For Me"],
"years_active": "2008-present"
},
{
"name": "Tim Godfrey",
"hits": ["Nara", "Agidigba", "Na You Be God"],
"years_active": "2006-present"
}
]
router = APIRouter()
@router.get("/liverpool")
async def get_random_musician():
"""Returns a random Nigerian gospel musician"""
musician = random.choice(musicians)
return {
"method": "GET",
"_verb": "get",
"musician": musician,
"features": {
"total_musicians": len(musicians),
"random_selection": True
}
}