MCPcopy Create free account
hub / github.com/chinobing/FastAPI-PaddleSpeech-Audio-To-Text / get_csv

Function get_csv

pstext/main.py:109–118  ·  view source on GitHub ↗
(request: Request, audio_id: int, db: Session = Depends(get_db))

Source from the content-addressed store, hash-verified

107
108@application.get("/download/{audio_id}")
109async def get_csv(request: Request, audio_id: int, db: Session = Depends(get_db)):
110 segment_data = crud.get_audio_segment_data(db, audio_id)
111 txt_all = []
112
113 for row in segment_data:
114 txt_all.append(row.segment_content)
115 df = pd.DataFrame(txt_all)
116
117 response = StreamingResponse(io.StringIO(df.to_csv(index=False)), media_type="text/csv")
118 return response

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected