https://github.com/matagus/shelve
🦀 A command-line tool written in Rust to pretty print files grouped by a column or field. It only support CSV files so far.
https://github.com/matagus/shelve
command-line command-line-tool console-tool csv groupby pretty-print rust rust-lang rust-language terminal-based tooling
Last synced: 3 months ago
JSON representation
🦀 A command-line tool written in Rust to pretty print files grouped by a column or field. It only support CSV files so far.
- Host: GitHub
- URL: https://github.com/matagus/shelve
- Owner: matagus
- License: mit
- Created: 2024-09-07T03:43:54.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-01-05T01:37:59.000Z (6 months ago)
- Last Synced: 2025-03-24T00:38:13.776Z (4 months ago)
- Topics: command-line, command-line-tool, console-tool, csv, groupby, pretty-print, rust, rust-lang, rust-language, terminal-based, tooling
- Language: Rust
- Homepage: https://crates.io/crates/shelve
- Size: 41 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# shelve
A command-line tool written in Rust for pretty-printing CSV files grouped by a specified column or field.
[](https://crates.io/crates/shelve)
[](https://docs.rs/shelve)
[](LICENSE)## Installation
```bash
cargo install shelve
```## Usage
```bash
shelve --helpUsage: shelve [OPTIONS] [FILENAME]...
Arguments:
FILENAME CSV file to read [default: stdin]Options:
-c, --column-number Column number to group by [default: 1] (first colum)
-h, --help Print help
-V, --version Print version
```## Examples
Given the following CSV file containing data about tasks and their status:
```csv
Task ID,Task Title,Status,Assignee,Priority
1,Implement feature A,In Progress,John Doe,High
2,Fix bug B,Done,Jane Doe,Low
3,Write tests for feature A,In Progress,John Doe,Medium
4,Refactor code,To Do,Jane Doe,High
5,Deploy to production A and B,To Do,John Doe,Low
6,Write missing documentation for feature A,Done,Peter Foo,Medium
7,Fix bug C,To Do,Alice Bar,High
8,Write tests for feature A,In Progress,John Doe,Low
```Grouping by the `Status` column (column number 2):
```bash
shelve -c 3 example.csvDone:
2, Fix bug B, Jane Doe, Low
6, Write missing documentation for feature A, Peter Foo, MediumIn Progress:
1, Implement feature A, John Doe, High
3, Write tests for feature A, John Doe, Medium
8, Write tests for feature A, John Doe, LowTo Do:
4, Refactor code, Jane Doe, High
5, Deploy to production A and B, John Doe, Low
7, Fix bug C, Alice Bar, High
```Grouping by the `Priority` column (column number 4):
```bash
shelve -c 5 example.csvHigh:
1, Implement feature A, In Progress, John Doe
4, Refactor code, To Do, Jane Doe
7, Fix bug C, To Do, Alice BarLow:
2, Fix bug B, Done, Jane Doe
5, Deploy to production A and B, To Do, John Doe
8, Write tests for feature A, In Progress, John DoeMedium:
3, Write tests for feature A, In Progress, John Doe
6, Write missing documentation for feature A, Done, Peter Foo
```Grouping by the `Assignee` column (column number 3):
```bash
shelve -c 4 example.csvAlice Bar:
7, Fix bug C, To Do, High
Jane Doe:
2, Fix bug B, Done, Low
4, Refactor code, To Do, HighJohn Doe:
1, Implement feature A, In Progress, High
3, Write tests for feature A, In Progress, Medium
5, Deploy to production A and B, To Do, Low
8, Write tests for feature A, In Progress, LowPeter Foo:
6, Write missing documentation for feature A, Done, Medium
```The command can also read input from `stdin`:
```bash
>> cat sample-files/tasks.csv | shelve -c 5High:
1, Implement feature A, In Progress, John Doe
4, Refactor code, To Do, Jane Doe
7, Fix bug C, To Do, Alice BarLow:
2, Fix bug B, Done, Jane Doe
5, Deploy to production A and B, To Do, John Doe
8, Write tests for feature A, In Progress, John DoeMedium:
3, Write tests for feature A, In Progress, John Doe
6, Write missing documentation for feature A, Done, Peter Foo
```Or reading multiple files at once:
```bash
shelve -c 5 sample-files/tasks.csv sample-files/more-tasks.csv
```## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.