Skip to content

v.category: Use CSV format instead of shell format#6132

Merged
petrasovaa merged 3 commits intoOSGeo:mainfrom
NishantBansal2003:csv/v-category
Aug 21, 2025
Merged

v.category: Use CSV format instead of shell format#6132
petrasovaa merged 3 commits intoOSGeo:mainfrom
NishantBansal2003:csv/v-category

Conversation

@NishantBansal2003
Copy link
Contributor

Fixes: #6025

Since the print style is not key-value format when using the shell output, I changed the format from shell to CSV for the report, print, and layers options.

Also, the changes in the last commit were not originally mentioned in the issue, but I felt that the CSV output should include headers. So, I added headers for the above-mentioned options in a backward-compatible way i.e., if the -g flag is given without specifying the CSV format, headers will be skipped.

I also read some discussions where we want CSV output to be more aligned with JSON. So, for the print option, I updated the CSV format to better match the structure of the JSON output.

Additionally, for both the print and report options, I added a separator option that can be used with CSV.

Let me know if any (or all) of the changes in the last commit are useful. If not, I’ll revert them.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
@github-actions github-actions bot added vector Related to vector data processing Python Related code is in Python C Related code is in C module tests Related to Test Suite labels Jul 28, 2025
@petrasovaa petrasovaa moved this to In Progress in GRASS JSON Outputs Aug 5, 2025
@echoix echoix requested a review from petrasovaa August 9, 2025 23:21
Copy link
Contributor

@cwhite911 cwhite911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the changes and agree that the csv output option should have the option to include a header.

@petrasovaa petrasovaa merged commit 10ea9e0 into OSGeo:main Aug 21, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in GRASS JSON Outputs Aug 21, 2025
@github-actions github-actions bot added this to the 8.5.0 milestone Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C module Python Related code is in Python tests Related to Test Suite vector Related to vector data processing

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feat] v.category should have format=csv instead of shell for report

3 participants