Skip to main content
https://travis-ci.org/cdumay/json-sort.svg?branch=master

json-sort

Just a tiny tool to sort keys in a json file

Quickstart

First, install json-sort using pip:

sh-4.2$ pip install json-sort

Next, use json-sort-fromfile or json-sort-fromremote:

sh-4.2$ json-sort-fromremote http://headers.jsontest.com/
{
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Host": "headers.jsontest.com",
    "User-Agent": "python-requests/2.10.0",
    "X-Cloud-Trace-Context": "8de3c28b6c503d26d38c1c7d6111bfa6/11298559371430510765"
}

Arguments

To see binaries usage, just set -h:

usage: json-sort-fromfile [-h] [--output FILE] [--verbose] file

positional arguments:
  file                  input file

optional arguments:
  -h, --help            show this help message and exit
  --output FILE, -o FILE
                        output file (default: stdout)
  --verbose             increase output verbosity

Example:

sh-4.2$ json-sort-fromfile --verbose --output test2.json ../test.json
DEBUG   : Checking file: /tmp/test.json
DEBUG   : Saving to: /tmp/json-sort/test2.json

License

Apache License 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json-sort-0.1.2.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file json-sort-0.1.2.tar.gz.

File metadata

  • Download URL: json-sort-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for json-sort-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2d51ab543ce0f43aeed8ecbec097c12584b1a02f788cbc596efd11740a794bab
MD5 1722f64de20002b73463420403da9b71
BLAKE2b-256 20194c53681215577329cf6644f352ebdf605e79cba83c5500bd96f32058b7d0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 file

0.1.1

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page