File size: 577 Bytes
ab6b1dd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
from covid import Covid
# Fonction pour obtenir les données COVID-19 d'un pays
def get_covid_data(country):
covid = Covid()
data = covid.get_status_by_country_name(country)
return data
# Interface Gradio
iface = gr.Interface(fn=get_covid_data,
inputs="text",
outputs="json",
title="COVID-19 Data by Country",
description="Enter the name of a country to get COVID-19 data.",
example="France")
# Lancement de l'interface
iface.launch()
|