feat: Implement core application structure, AI extraction, persistence, and Telegram bot modules with updated configuration and dependencies.

This commit is contained in:
Marco Gallegos
2025-12-18 12:15:04 -06:00
parent 7276e480b0
commit 899482580e
45 changed files with 1157 additions and 225 deletions

View File

@@ -0,0 +1,23 @@
"""
Functions for exporting data to other formats or systems (e.g., CSV, Google Sheets).
"""
import csv
import io
from typing import List
from app.schema.base import FinalExpense
def export_to_csv(expenses: List[FinalExpense]) -> str:
"""
Exports a list of expenses to a CSV formatted string.
"""
output = io.StringIO()
writer = csv.writer(output)
# Write header
writer.writerow(FinalExpense.__fields__.keys())
# Write data
for expense in expenses:
writer.writerow(expense.dict().values())
return output.getvalue()