Skip to content

Feature: add --csv export to faircode profile and faircode compare #739

Description

@yakew7

Where: faircode/cli.py (profile/compare subparsers), faircode/report.py, faircode/benchmark.py.

Current gap: profile and compare only support --json and --html output formats; report.py has no to_csv/compare_to_csv function (grep -n "csv" faircode/report.py returns nothing). Meanwhile faircode benchmark writes results_fairness.csv, results_performance.csv, and summary.csv as its primary output format - CSV is already an established, expected export convention elsewhere in this same CLI, just not on the two commands analysts are most likely to want it from (e.g. to drop a dimension's per-group shares/CIs straight into a spreadsheet or BI tool).

Repro:

$ grep -n "\-\-json\|\-\-html\|\-\-csv" faircode/cli.py
... --json and --html present on profile/compare; no --csv anywhere on either
$ grep -n "csv" faircode/report.py
(no output)

Suggested approach: add --csv PATH to both profile and compare that writes a flat table (one row per group per dimension: dimension,kind,label,count,share,ci_low,ci_high,under_represented,small_group, plus a section for flags), following the same "write to PATH, print a confirmation to stderr" pattern already used for --html.

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

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions