Youssouf Traore
commited on
Commit
·
ab6b1dd
1
Parent(s):
31e56fa
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from covid import Covid
|
3 |
+
|
4 |
+
# Fonction pour obtenir les données COVID-19 d'un pays
|
5 |
+
def get_covid_data(country):
|
6 |
+
covid = Covid()
|
7 |
+
data = covid.get_status_by_country_name(country)
|
8 |
+
return data
|
9 |
+
|
10 |
+
# Interface Gradio
|
11 |
+
iface = gr.Interface(fn=get_covid_data,
|
12 |
+
inputs="text",
|
13 |
+
outputs="json",
|
14 |
+
title="COVID-19 Data by Country",
|
15 |
+
description="Enter the name of a country to get COVID-19 data.",
|
16 |
+
example="France")
|
17 |
+
|
18 |
+
# Lancement de l'interface
|
19 |
+
iface.launch()
|