Skip to content
/ tsj Public

Tab-seperated JSONs (TSJ) format: Quoting no more, json serialized, easy to read!

License

Notifications You must be signed in to change notification settings

CourierKyn/tsj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

tsj

tsj (Tab-seperated JSONs) is a simple text format just like tsv, but more robust and elegant!

  • Each value is JSON-serialized, and that includes any naughty strings containing \n, \t or even any data structure.

  • Tab seperated, super easy to edit and read by humans.

  • No more quoting character like ", "", """". I hate double quoting!

  • Hand coded loading and writing function, easy to handle by yourself.


Super easy example in Python:

header = ('index', 'a', 'b', 'c')
data = [[0, 'hello', 'world', 42],
        [1, 'llo\r\nhe', 'ld\twor', 24],
        ...]

for row in (header, *data):
    writer.write('\t'.join(map(json.dumps, row)) + '\n')

# "index"    "a"            "b"          "c"
# 0          "hello"        "world"      42
# 1          "llo\r\nhe"    "ld\twor"    24

It just works.

About

Tab-seperated JSONs (TSJ) format: Quoting no more, json serialized, easy to read!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published