Skip to content

Feature: Export data to XLSX format #2

Description

@codewizdave

Summary

Add the ability to export posts, comments, and subreddit data to XLSX format for analysis in spreadsheet applications.

Motivation

Currently, all data is displayed in the terminal only. Users who want to analyze Reddit data in Excel, Google Sheets, or other tools must manually copy/paste or use workarounds. Providing direct XLSX export would streamline workflows for:

  • Data analysis
  • Reporting
  • Archiving
  • Cross-referencing with other datasets

Proposed Solution

Add an --output or --format option to commands that fetch data:

# Export subreddit posts to xlsx
reddit browse python --limit 100 --output posts.xlsx

# Export comments to xlsx
reddit comments t3_abc123 --output comments.xlsx

# Export subreddit info
reddit subreddit python --output subreddit.xlsx

Data to Export

Posts

  • ID, Title, Author, Subreddit
  • Score, Number of Comments
  • URL, Permalink
  • Created Date
  • Selftext (if applicable)

Comments

  • ID, Author, Body
  • Score, Created Date
  • Parent ID, Link ID
  • Depth

Subreddits

  • Name, Title
  • Subscribers, Active Users
  • Description

Implementation Considerations

  • Use a lightweight library like openpyxl or xlsxwriter
  • Add as optional dependency: pip install better-reddit-cli[xlsx]
  • Validate file path and permissions before writing
  • Show progress for large exports

Priority

priority:medium

Effort

effort:m

Labels

feature, priority:medium, effort:m, ready

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions