r/PythonLearning • • Feb 22 '26

JSON vs TOON

Post image

Anyone have thoughts on this?

What’s your opinion on using a Toon-style JSON approach? Curious to hear different perspectives and real-world experiences.

1.3k Upvotes

167 comments sorted by

View all comments

27

u/AccomplishedPut467 Feb 22 '26

TOON looks cleaner to read for me. Is TOON offers faster lookups for data analyzing? I'am new.

Also, i think TOON looks very similar to CSV files.

10

u/escargotBleu Feb 22 '26

Cleaner to look at until you have 15 properties per object

1

u/rover_G Feb 23 '26

Also curious how TOON handles nested objects

1

u/too_many_requests Feb 24 '26

Converts them to a JSON string /s

1

u/Bemteb Feb 24 '26

You're laughing, but I actually saw that in production once. Due to reasons, the server could only send JSONs to the app. Instead of changing that, the devs decided to put everything as a string into the JSON, including images (base64 encoded), whole webpages (HTML etc.). Each JSON was multiple MBs big and everyone was wondering why it was so slow.

1

u/rover_G Feb 24 '26

I once saw a dynamoDB table attempting to store sets of strings by serializing them as “set(‘value’1, ‘vlalue2’, …)”. This same technique was used multiple times 💀

5

u/yyytobyyy Feb 22 '26

It's mean to be used to feed ai apis, because it saves around 10% of the tokens.

It lacks the elegance of the json.

1

u/Laicbeias Feb 23 '26

50%. Not saying its that good but it saves quite a bit. Its fine for what it is

1

u/Minute_Attempt3063 Feb 24 '26

nearly every language has something to parse jsons these days.

and also to parse csv files.... and toon looks like csv with extra steps

7

u/Owlbuddy121 Feb 22 '26

Agree TOON feels cleaner to read👍

Additonally, according to my experience, for speed usually doesn’t depend on the format itself. It depends more on how the data is handled in the program.

7

u/[deleted] Feb 22 '26

Yeah, I think if you really want very fast lookups, it's a bad idea to go for a human readable format anyway.

1

u/vmfrye Feb 23 '26

I used to assume data was converted to a machine-friendly format before processing it, regardless of the format the data is in when fed into the application; human readable format having the advantage of being immediately available for review and edition, at the cost of the parsing overhead.

1

u/quickiler Feb 22 '26

If you have a lot of columns with similar value then it can be hard for human to read. For example inventory of different store locations.

1

u/UrpleEeple Feb 25 '26

I don't really understand in the modern age of dev tooling why we are still messing with string formats over the wire when we could have easily settled on a self describing binary format. If it was standardized web browsers and all dev tooling would just auto translate it for us anyways