Metadata-Version: 2.4
Name: jsonreflow
Version: 0.4.0
Summary: Indented JSON, but with one-line arrays or objects if they fit a desired line length.
Project-URL: Repository, https://github.com/soxofaan/jsonreflow
Project-URL: Changelog, https://github.com/soxofaan/jsonreflow/blob/main/CHANGELOG.md
Author-email: Stefaan Lippens <soxofaan@gmail.com>
License-Expression: MIT
License-File: LICENSE.txt
Keywords: JSON,serialization
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: File Formats :: JSON
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Provides-Extra: dev
Requires-Dist: pytest>=8.3; extra == 'dev'
Description-Content-Type: text/markdown


# JSON Reflow

Python library and CLI tool to reflow JSON files and streams,
to allow a better compromise between

- compactness:
  try to fit short arrays and objects on a single line,
  within a given line length limit
- human readability:
  indented JSON for larger constructs otherwise.



## The problem

Standard JSON serialization tools typically only support two extremes:

- put everything on a single line:
  the most compact, but very poor for human readability

- spread out each and every array item and object property on its own line
  with appropriate indentation to visualize the structure.
  This is easier for humans to parse visually
  (which is why it is often referred to as "prettifying" or "beautifying"),
  but for larger documents, this easily becomes unwieldy, "too vertical"
  and very space-inefficient because of all the repeated indentation.

JSON Reflow allows to find a better compromise:
only serialize arrays or objects over multiple lines
if the single-line approach would exceed a given line length.
