Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vi/rendercsv
Tool to convert CSV table to a picture.
https://github.com/vi/rendercsv
animation csv csv2pic csv2png data-analysis picture png table table-renderer visualization
Last synced: about 1 month ago
JSON representation
Tool to convert CSV table to a picture.
- Host: GitHub
- URL: https://github.com/vi/rendercsv
- Owner: vi
- Created: 2024-08-07T22:12:07.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-08-07T22:13:07.000Z (3 months ago)
- Last Synced: 2024-10-05T06:14:52.596Z (about 1 month ago)
- Topics: animation, csv, csv2pic, csv2png, data-analysis, picture, png, table, table-renderer, visualization
- Language: Rust
- Homepage:
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rendercsv
Command line tool to quicky get picture from CSV file, manually specifyig cell dimensions. Main use case is to create create animated tables from a series of CSV files (obtained e.g. using `qsv partition --drop`).
## Features
* Rotating specific cells (to economize horizontal space in header row)
* Setting colour of specific cells (to emulate conditional formatting)## Limitations
* Table geometry is not calculated. You need to specify a number of command line parameters for the table to looks OK.
* Text alignment is fixed.
* Default font is lean. Specify custom font to render more text.## Cell text prefixes
Text in a cell is parsed for the following prefixes:
* `rot:` - rotate this cell
* `l=N:` - set cell background colour lightness to N
* `s=N:` - set cell background colour saturation to N
* `h=N:` - set cell background colour hue to N## Example
```
$ cat test.csv
row,rot:Alpha Bravo,rot:Charlie Delta,rot:Echo Foxtrot
row1,1,2,3
row2,2,3,h=30:s=40:19
row3,l=90:0,l=90:0,l=90:0$ rendercsv test.csv test2.png --first-column-width 40 --column-width 16 --first-row-height 90 -W 100 -H 150
```![test.png](test.png)
## Installation
Download a pre-built executable from [Github releases](https://github.com/vi/rendercsv/releases) or install from source code with `cargo install --path .` or `cargo install rendercsv`.
## CLI options
rendercsv --help output
```
Usage: rendercsv [OPTIONS]Arguments:
Options:
-W, --width
[default: 1280]
-H, --height
[default: 720]
--font
font file (ttf) to render legend text. Default is embedded font Dharma Type Sometype Mono
-s, --font-scale
Text size [default: 12.0]
-Y, --first-row-height
[default: 60]
-y, --row-height
[default: 16]
-X, --first-column-width
[default: 80]
-x, --column-width
[default: 60]
-h, --help
Print help
```