Skip to content

Add support of JSONL and CSV input file formats in CLI tabulate utility - #419

Merged
astanin merged 7 commits into
masterfrom
dev/jsonl
Mar 11, 2026
Merged

Add support of JSONL and CSV input file formats in CLI tabulate utility#419
astanin merged 7 commits into
masterfrom
dev/jsonl

Conversation

@astanin

Copy link
Copy Markdown
Owner

fix#173

New CLI parameters:

--headers HEADERS
where HEADERS can be "firstrow", "keys", "HEADER1,HEADER2,..." (for CSV data), "HEADER1,KEY2:HEADER2,..." (for JSONL data)

--read FILEFORMAT
where FILEFORMAT can be "rsv" (default), "csv", "jsonl"

Deprecated CLI parameter:

  • --header

Usage examples:

cat ./examples/people.csv | tabulate -r csv --headers firstrow
id name email "favorite" fruit
---- ------ ----------------- ------------------
1 Alice alice@example.com apple, kiwi
2 Bob bob@example.com banana,
orange,
lychee
3 Carol pear
cat ./examples/people.jsonl | tabulate -r jsonl -f grid --headers 'id:ID,name:First Name,email:Email'
+------+--------------+-------------------+
| ID | First Name | Email |
+======+==============+===================+
| 1 | Alice | alice@example.com |
+------+--------------+-------------------+
| 2 | Bob | bob@example.com |
+------+--------------+-------------------+

fix#173
New CLI parameter:
--headers HEADERS
where HEADERS can be "firstrow", "keys", "HEADER1,HEADER2,...", "KEY1:HEADER1,KEY2:HEADER2,..."
--read FILEFORMAT
where FILEFORMAT can be "rsv" (default), "csv", "jsonl"
Deprecated CLI parameter:
--header
Usage examples:
cat ./examples/people.csv | tabulate -r csv --headers firstrow
id name email "favorite" fruit
---- ------ ----------------- ------------------
1 Alice alice@example.com apple, kiwi
2 Bob bob@example.com banana,
orange,
lychee
3 Carol pear
cat ./examples/people.jsonl | tabulate -r jsonl -f grid --headers 'id:ID,name:First Name,email:Email'
+------+--------------+-------------------+
| ID | First Name | Email |
+======+==============+===================+
| 1 | Alice | alice@example.com |
+------+--------------+-------------------+
| 2 | Bob | bob@example.com |
+------+--------------+-------------------+
- old tests: launch tabulate via subprocess (still necessary)
- new tests: the same checks for coverage reports
@codecov-commenter

codecov-commenter commented Mar 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.11538% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.18%. Comparing base (2070736) to head (5313627).
⚠️ Report is 8 commits behind head on master.

Files with missing linesPatch %Lines
tabulate/__main__.py0.00%2 Missing ⚠️
tabulate/__init__.py0.00%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## master #419 +/- ##
==========================================
+ Coverage 84.43% 90.18% +5.75% 
==========================================
Files 1 3 +2 Lines 906 958 +52 Branches 218 228 +10 ==========================================
+ Hits 765 864 +99 + Misses 107 60 -47 
Partials 34 34 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@astaninastanin added this to the v0.11.0 milestone Mar 10, 2026
@astaninastanin added CLI enhancement New feature or request labels Mar 10, 2026
@astaninastanin mentioned this pull request Mar 10, 2026
@astanin
astanin merged commit 52dc17b into masterMar 11, 2026
34 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLIenhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to tabulate JSON from stdin?

2 participants

@astanin@codecov-commenter