Pata is an utility to helps for automation and data processing tasks.
Mainly with
- POSIX shell (bash when POSIX is too poor)
- grep,sed,find,cut,...
But also with some thirdparty utils:
- jq (for all json stuff)
- tidy (for html to xml)
- xml2json.py (for xml to json)
- csv2json.py (for csv to json)
Some experimental stuff use:
- sqlite3 (for SQL)
- xls, xlsx ods support (to read from spreadsheet files)
- curl,wget (for download and REST API)
- ping (for network stuff)
- csv/json_array
- csv/json_object
- json_array/csv
- json_object/csv ( json_object/json_array + json_array/csv )
- json_object/json_array
- json_object/rgrep ( json/rgrepn + rgrepn/rgrep )
- json_object/rgrepn
- xml/json
- html/json
- html/xml
- rgrepn/json_object
- rgrepn/rgrep
- rgrep/json_object ( rgrep/rgrepn + rgrepn/json_object )
- rgrep/rgrepn
- yaml/json
TODO:
- xls/json
- xlsx/json
- ods/json
- mbox <-> json
- maildir/maildir+ <-> json
- http header <-> json
- curl (header and body) <-> json
- json/yaml
col to row | csv | json_a | json_o | xml | yaml | html | rgrepn | rgrep |
---|---|---|---|---|---|---|---|---|
csv | - | yes | yes | no | no | no | no | no |
json_array | yes | - | yes | - | - | no | no | |
json_object | yes | TODO | - | - | - | yes | yes | |
json(struct) | - | - | - | yes | yes | yes | - | - |
xml | no | no | no | - | yes | no | no | |
html | no | no | no | no | TODO** | no | no | |
rgrepn | no | no | yes | no | no | - | yes | |
rgrep | no | no | yes | no | no | yes | - | |
yaml | TODO | TODO |
(*: via convertion) (**: via tidy )
jsonA means json array like :
[
["head1", "head2", "head3"],
["x=1 y=1", "x=2 y=1", "x=3 y=1",
["x=1 y=2", "x=2 y=2", "x=3 y=2"
]
jsonO means json Object like :
[
{"head1": "x=1 y=1", "head2": "x=2 y=1", "head3": "x=3 y=1"},
{"head1": "x=1 y=2", "head2": "x=2 y=2", "head3": "x=3 y=2"}
]
- csv2json.py
- (lua ?)
- jq
- (py ? lua ?)
- jq
- (py ? lua ?)
Alias: json to rgrepn, rgrepn to rgrep
Alias: html to xml, xml to json
tidy -asxml
Rewrite "bad" html to strict html.
tidy -ashtml
- jq
- (py ? lua ?)
- sh
- (py ? lua ?)
Alias: rgrep to rgrepn, rgrepn to json