Skip to main content

Pretty Format JSON

Pretty print JSON containing Python-style comments and string literals.

pip3 install pretty-format-json

Binaries

  • pretty_format_json: convert text to JSON, supports Python style (comments, single quotes, trailing commas) and NodeJS style (bare keys, JS booleans)
  • csv_json: convert between CSV and JSON
  • yaml_json: convert between YAML and JSON

Usage

echo "{a: 1, 'b': 2,}" | pretty_format_json

Use it in VIM

Add the following lines to your config file:

noremap <a-j> :%!pretty_format_json<CR>
noremap <a-k> :%!yaml_json<CR>
noremap <a-c> :%!csv_json<CR>

When you open a blank buffer, paste the text copied from somewhere, then use Alt+j to convert to JSON, use Alt+k to convert to YAML and back to JSON.

Environment variables

  • JSON_INDENT: indent width (default 2)
  • JSON_SORT_KEYS: sort keys if set
  • DATE_FORMAT: datetime output format (default ISO)

Download files

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

Source Distribution

pretty_format_json-0.2.23.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pretty_format_json-0.2.23-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pretty_format_json-0.2.23.tar.gz.

File metadata

  • Download URL: pretty_format_json-0.2.23.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pretty_format_json-0.2.23.tar.gz
Algorithm Hash digest
SHA256 f7a0a9087136584aa966555d07ca31cd0a450ef9cf8a3ac180052a99e5cfba48
MD5 89615dd3700861da2b277910a4693a34
BLAKE2b-256 d1a306326844b2a274929a43eaa084ede188bdee7b1149c29b8ecd54e1f7f955

See more details on using hashes here.

File details

Details for the file pretty_format_json-0.2.23-py3-none-any.whl.

File metadata

  • Download URL: pretty_format_json-0.2.23-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pretty_format_json-0.2.23-py3-none-any.whl
Algorithm Hash digest
SHA256 62a5479cc2265d75783043bcd03fecfe9ea6ac98570d6f48146df9940e59100d
MD5 553ff2ab816038183d5235237e243940
BLAKE2b-256 93d3804123f480e6d08291b1d5610e98ee031f04990884b89ec989a3047c07dd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.23 This release

2 files

0.2.22

1 file

0.2.21

1 file

0.2.20

1 file

0.2.19

1 file

0.2.18

1 file

0.2.17

1 file

0.2.16

1 file

0.2.15

1 file

0.2.14

1 file

0.2.13

1 file

0.2.12

1 file

0.2.11

1 file

0.2.10

1 file

0.2.9

1 file

0.2.8

1 file

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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