Skip to content

Conversation

@ATOMworkplace
Copy link
Contributor

PR Description
Description This PR introduces data persistence features, allowing users to export their session history (Moods and Journal entries) to CSV or PDF formats and restore them later via CSV import. This resolves the need for users to save their mental health tracking data.

Changes Made

  • New Feature: Added a "Data & Settings" page in the sidebar.
  • Export: implemented CSV download for Mood/Journal history using pandas and PDF report generation using fpdf.
  • Import: Added functionality to upload CSV files and restore history into the current session.
  • State Management: Updated st.session_state to track mood_history and journal_history lists instead of just displaying immediate results.
  • Dependencies: Added pandas and fpdf to requirements.txt.

Related Issue Closes #5

How to Test

  • Run the app: streamlit run app.py.
  • Go to "Mood" or "Journal" and add a few entries.
  • Navigate to the "Data & Settings" page.
  • Try downloading the CSV and PDF.
  • Refresh the page (to clear session) and use the "Import" tab to upload the previously downloaded CSV. Verify the data is restored.

Preview
image

image

@Pragati1466 Pragati1466 merged commit b8e6fc5 into Pragati1466:main Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export & Import Mood Journal History (CSV/PDF)

2 participants