From 22ce635f14fed0d12ceda8550f6382048b10d7f4 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Sun, 22 May 2022 15:39:31 +0200 Subject: [PATCH] added in-memory conversion to excel file --- utils/df_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utils/df_utils.py b/utils/df_utils.py index 58615ba..c5d2c45 100644 --- a/utils/df_utils.py +++ b/utils/df_utils.py @@ -16,3 +16,14 @@ class DateFrameHolder: +from io import BytesIO + + +def to_excel_binary(df): + with BytesIO() as out: + df.to_excel(out) + res = out.getvalue() + return res + + +