https://github.com/weaming/tablib
Parse 2d tabular data bettwen YAML, JSON, CSV.
https://github.com/weaming/tablib
Last synced: 10 months ago
JSON representation
Parse 2d tabular data bettwen YAML, JSON, CSV.
- Host: GitHub
- URL: https://github.com/weaming/tablib
- Owner: weaming
- License: mit
- Created: 2018-11-08T13:32:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T14:46:34.000Z (about 7 years ago)
- Last Synced: 2025-03-02T08:29:11.680Z (over 1 year ago)
- Language: Crystal
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/weaming/tablib/releases)
# Tablib
Parse 2d tabular data bettwen YAML, JSON, CSV.
## Installation
### Mac
```
brew tap weaming/tap
brew install tabular
```
### Manual
```
git clone https://github.com/weaming/tablib
crystal build --release src/tabular.cr
mv tabular /usr/local/bin
```
## Usage
```
$ ./tabular --help
tabular -- Convert between CSV, JSON, YAML. The JSON is the bridge betwwen CSV and YAML.
Usage:
tabular [options] [arguments] ...
Options:
-f FILE, --file=FILE The file [type:String] [default:"/dev/stdin"]
-t TYPE, --type Allow CSV or YAML [type:String] [default:"YAML"]
-i, --indent Option description. [type:Int32] [default:2]
--help Show this help.
--version Show version.
```
### Interact with VIM
Add to your `.vimrc`
```
" brew install tabular
nnoremap :%!tabular -f /dev/stdin -t yaml
nnoremap :%!tabular -f /dev/stdin -t csv
```
## Development
1. `git clone`
1. `shards install`
1. `crystal run src/tabular.cr -- -f test.json -t csv`
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [weaming](https://github.com/weaming) weaming - creator, maintainer
## TODO
* [ ] JSON output custom indent