Skip to content

Add CSV/JSON export for expenses and bills #589

@sofia-willow

Description

@sofia-willow

Problem

The README mentions CSV/Excel export as a premium feature, but there's no implementation yet. Users need a way to export their financial data for tax prep, spreadsheet analysis, or migration.

Proposed Solution

Add export endpoints:

  • GET /expenses/export?format=csv — Export expenses as CSV
  • GET /expenses/export?format=json — Export expenses as JSON array
  • GET /bills/export?format=csv — Export bills as CSV

Query Parameters

  • format: csv or json (default: csv)
  • from / to: Date range filter
  • category_id: Filter by category

CSV Format

date,amount,currency,category,type,notes
2026-03-15,42.50,USD,Food,EXPENSE,Lunch with team

Implementation Notes

  • Uses stdlib csv module (no new dependencies)
  • Proper Content-Disposition header for file download
  • Respects existing auth (JWT required)
  • Integrates with existing expense query filters

Acceptance Criteria

  • Export endpoints return valid CSV/JSON
  • Date range filtering works
  • Auth-protected
  • Tests included
  • No new dependencies

I can submit a PR for this if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions