json-tools .ru

Python dict to JSON

Parses a Python literal or debug output and turns it into JSON — the classic case is copying an object straight out of print() or a Django/Odoo console.

What the parser understands

dict, list, tuple, and set are all supported, along with True/False/None, which become true/false/null. tuple and set both turn into a plain JSON array on output, since JSON has no separate types for them.

Debug and Odoo output

Odoo-style values like <Command.SET: 6> are kept as the string "Command.SET: 6", and datetime.datetime(2024, 1, 5, 10, 30) with numeric arguments turns into the readable string 2024-01-05T10:30:00 — JSON has no way to describe those objects otherwise.

Format
Python → JSON
Source text Paste text or upload a file
Result Type is not detected yet
Statistics appear after formatting