Trying to make the output download an excel file or display a dataframe
See original GitHub issueHi, 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:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That worked … thank you so much @LukasMasuch … closing the issue 😃
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.