question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to make the output download an excel file or display a dataframe

See original GitHub issue

Hi, I have been doodling with opyrator, I think it is awesome. I got stuck in trying to make the output for the user is to download an excel file generated following the model you have in upscaling the image and spleeter example ` class HelixPredictOutput(BaseModel): upscaled_image_file: FileContent = Field( …, mime_type=“application/excel”, description=“excel file download”, )

def image_super_resolution( input: HelixPredictInput, ) -> HelixPredictOutput:

with open("aa.xlsx", "rb") as f:
            excel_outfile = f.read()

return HelixPredictOutput(
            upscaled_image_file=excel_outfile)

` But that gave me a weird zip file when I press on the download button that was unsupported. Is there anyway to make it download the excel file?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
batman984commented, May 5, 2021

That worked … thank you so much @LukasMasuch … closing the issue 😃

1reaction
raethleincommented, May 5, 2021

Ah, great that works! My post was about the Swagger API (via launch-api) where you can also download the response, but I guess the question was raised in the context of the Streamlit UI which probably makes more sense. Sorry @batman984 for pointing you to the wrong direction previously.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Export Pandas DataFrame to an Excel File - Data to Fish
You can export Pandas DataFrame to an Excel file using to_excel. Here is a template that you may apply in Python to export...
Read more >
Exporting a Pandas DataFrame to an Excel file - GeeksforGeeks
Create the DataFrame. Determine the name of the Excel file. Call to_excel() function with the file name to export the DataFrame. Example 1:....
Read more >
How to export Pandas' DataFrames to Excel - YouTube
In this tutorial, we are going to learn how to export a Panda's DataFrame to an Excel workbook. Excel being the most popular...
Read more >
pandas.DataFrame.to_excel — pandas 1.5.2 documentation
Write object to an Excel sheet. To write a single object to an Excel .xlsx file it is only necessary to specify a...
Read more >
Write Excel with Python Pandas
To export a Pandas DataFrame as an Excel file (extension: .xlsx, .xls), use the to_excel() method. Related course: Data Analysis with Python Pandas ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found