diff --git a/docs/parsers/asciitable.md b/docs/parsers/asciitable.md index 8a4ced2a..15b869bd 100644 --- a/docs/parsers/asciitable.md +++ b/docs/parsers/asciitable.md @@ -43,7 +43,7 @@ For example: good day 12345 hi there abc def - etc. + etc... Usage (cli): @@ -65,11 +65,45 @@ Schema: Examples: - $ asciitable | jc --asciitable -p - [] + $ echo ' + > ╒══════════╤═════════╤════════╕ + > │ foo │ bar │ baz │ + > ╞══════════╪═════════╪════════╡ + > │ good day │ │ 12345 │ + > ├──────────┼─────────┼────────┤ + > │ hi there │ abc def │ 3.14 │ + > ╘══════════╧═════════╧════════╛' | jc --asciitable -p + [ + { + "foo": "good day", + "bar": null, + "baz": "12345" + }, + { + "foo": "hi there", + "bar": "abc def", + "baz": "3.14" + } + ] - $ asciitable | jc --asciitable -p -r - [] + + $ echo ' + > foo bar baz + > --------- -------- ------ + > good day 12345 + > hi there abc def' | jc --asciitable -p + [ + { + "foo": "good day", + "bar": null, + "baz": "12345" + }, + { + "foo": "hi there", + "bar": "abc def", + "baz": null + } + ] diff --git a/docs/parsers/asciitable_m.md b/docs/parsers/asciitable_m.md index 7c416618..2e72cfca 100644 --- a/docs/parsers/asciitable_m.md +++ b/docs/parsers/asciitable_m.md @@ -63,7 +63,7 @@ Examples: { "foo": "good day\nmate", "bar": "12345", - "baz_buz": "" + "baz_buz": null }, { "foo": "hi there", @@ -87,7 +87,7 @@ Examples: { "foo": "good day\nmate", "bar": "12345", - "baz_buz": "" + "baz_buz": null }, { "foo": "hi there", diff --git a/jc/parsers/asciitable.py b/jc/parsers/asciitable.py index f61de96c..8e0af9c3 100644 --- a/jc/parsers/asciitable.py +++ b/jc/parsers/asciitable.py @@ -38,7 +38,7 @@ For example: good day 12345 hi there abc def - etc. + etc... Usage (cli): @@ -60,11 +60,45 @@ Schema: Examples: - $ asciitable | jc --asciitable -p - [] + $ echo ' + > ╒══════════╤═════════╤════════╕ + > │ foo │ bar │ baz │ + > ╞══════════╪═════════╪════════╡ + > │ good day │ │ 12345 │ + > ├──────────┼─────────┼────────┤ + > │ hi there │ abc def │ 3.14 │ + > ╘══════════╧═════════╧════════╛' | jc --asciitable -p + [ + { + "foo": "good day", + "bar": null, + "baz": "12345" + }, + { + "foo": "hi there", + "bar": "abc def", + "baz": "3.14" + } + ] - $ asciitable | jc --asciitable -p -r - [] + + $ echo ' + > foo bar baz + > --------- -------- ------ + > good day 12345 + > hi there abc def' | jc --asciitable -p + [ + { + "foo": "good day", + "bar": null, + "baz": "12345" + }, + { + "foo": "hi there", + "bar": "abc def", + "baz": null + } + ] """ import re from typing import List, Dict diff --git a/jc/parsers/asciitable_m.py b/jc/parsers/asciitable_m.py index 415fef0b..63f59a27 100644 --- a/jc/parsers/asciitable_m.py +++ b/jc/parsers/asciitable_m.py @@ -58,7 +58,7 @@ Examples: { "foo": "good day\nmate", "bar": "12345", - "baz_buz": "" + "baz_buz": null }, { "foo": "hi there", @@ -82,7 +82,7 @@ Examples: { "foo": "good day\nmate", "bar": "12345", - "baz_buz": "" + "baz_buz": null }, { "foo": "hi there",