Skip to content

feat: add transparent gzip decompression support#198

Open
devnulls wants to merge 1 commit intoYS-L:mainfrom
devnulls:feat/gzip-support
Open

feat: add transparent gzip decompression support#198
devnulls wants to merge 1 commit intoYS-L:mainfrom
devnulls:feat/gzip-support

Conversation

@devnulls
Copy link
Copy Markdown

@devnulls devnulls commented Mar 3, 2026

Summary

  • Adds transparent gzip decompression so csvlens data.csv.gz just works
  • Detects .gz extension and decompresses into the existing temp file, so no changes needed to CSV parsing, delimiter sniffing, or the app layer
  • Adds flate2 dependency for gzip decoding

Changes

  • Cargo.toml: add flate2 = "1"
  • src/io.rs: is_gzip() helper + gzip branch in SeekableFile::new() using GzDecoder
  • tests/data/small.csv.gz: test fixture
  • src/io.rs tests: test_is_gzip() and test_gzip_file()

Test plan

  • cargo build succeeds
  • cargo test — all 108 tests pass (including 2 new ones)
  • Manual: csvlens tests/data/small.csv.gz displays the CSV
  • Manual: zcat tests/data/small.csv.gz | csvlens still works (existing stdin path)

🤖 Generated with Claude Code

Allow opening gzip-compressed CSV/TSV files (e.g. data.csv.gz) directly
without manual decompression. Gzip files are detected by .gz extension
and decompressed into the existing temp file path, so downstream code
is unaffected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant