Upload timeseries as csv or excel files.
meteoDaniel opened this issue · 2 comments
Dear guys,
I am interested in using opyrator. In our use case we would like to upload timeseries data in csv or excel files.
Is this supported?
And If not, can you recommend tools that are able to read generic csv files that can be added to opyrator?
Thanks a lot for discussing
Daniel
Hey @meteoDaniel, sorry for the delayed answer! I am not sure whether I understood the question correctly, but in case you would like to upload a csv / excel file to the opyrator function, you should be able to define the input as in the following example:
from opyrator.components.types import FileContent
from pydantic import BaseModel, Field, validator
class Input(BaseModel):
excel_file: FileContent = Field(
...,
mime_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
)
class Output(BaseModel):
excel_file: FileContent = Field(
...,
mime_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
)
def return_file(input: Input) -> Output:
return Output(excel_file=input.excel_file.as_bytes())
I copied the code from this issue which might provide some more context. I hope this helps :)
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days