ramonhagenaars / jsons

🐍 A Python lib for (de)serializing Python objects to/from JSON
https://jsons.readthedocs.io
MIT License
288 stars 40 forks source link

Ability to format json #146

Open benjwarner opened 2 years ago

benjwarner commented 2 years ago

Have gone through the documentation. I can't see any flags to product formatted (indented) json.

Is this possible?

ramonhagenaars commented 2 years ago

This is possible by providing the corresponding arguments to the underlying json lib:

jsons.dumps(your_instance, jdkwargs={"indent":4})