Skip to content

Feature request: Have a more consise format #2

@olibre

Description

@olibre

Thank you for you sweet JSON printer, I am using and enjoying it. 🤩
But, pprintjson often uses unnecessary room and I request an option to get a more concise display.

You may be inspired from file prettyjson.py described in that SO answer.

Example of a concise representation converted to an unnecessary verbose one:

$ pprintjson -c '
{
  "grid": {"port": "COM5"},
  "policy": {
    "movingaverage": 5,
    "hysteresis": 5,
    "fan1": {
      "name": "CPU",
      "signal": "cpu",
      "mode": "auto",
      "speed": 100,
      "curve": [[0, 75], [50, 75], [75, 100]]
    }
  }
}'
{
    "grid": {
        "port": "COM5"
    },
    "policy": {
        "movingaverage": 5,
        "hysteresis": 5,
        "fan1": {
            "name": "CPU",
            "signal": "cpu",
            "mode": "auto",
            "speed": 100,
            "curve": [
                [
                    0,
                    75
                ],
                [
                    50,
                    75
                ],
                [
                    75,
                    100
                ]
            ]
        }
    }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions