Spaces:
Sleeping
Sleeping
Nikhil Singh
commited on
Commit
·
227804c
1
Parent(s):
289ed0c
proper edits
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import os
|
2 |
import gradio as gr
|
3 |
from mailparser import parse_from_string
|
4 |
|
@@ -16,10 +15,23 @@ def receive_mail(name):
|
|
16 |
|
17 |
def greet(name):
|
18 |
email_info = receive_mail(name)
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
23 |
|
24 |
-
demo = gr.Interface(fn=greet,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
demo.launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from mailparser import parse_from_string
|
3 |
|
|
|
15 |
|
16 |
def greet(name):
|
17 |
email_info = receive_mail(name)
|
18 |
+
return ([email_info["Subject"],
|
19 |
+
email_info["From"],
|
20 |
+
email_info["To"],
|
21 |
+
email_info["Date"],
|
22 |
+
email_info["Message ID"],
|
23 |
+
email_info["Headers"],
|
24 |
+
email_info["Attachments"]])
|
25 |
|
26 |
+
demo = gr.Interface(fn=greet,
|
27 |
+
inputs="text",
|
28 |
+
outputs=["text",
|
29 |
+
"text",
|
30 |
+
"text",
|
31 |
+
"text",
|
32 |
+
"text",
|
33 |
+
"text",
|
34 |
+
"text"],
|
35 |
+
title="Email Info",
|
36 |
+
description="Enter the email content below to view its details.")
|
37 |
demo.launch()
|