Metadata-Version: 2.4
Name: pretty-format-json
Version: 0.2.23
Summary: Pretty print JSON containing Python style comments and string literals.
Home-page: https://github.com/weaming/pretty-format-json
Author: weaming
Author-email: garden.yuen@gmail.com
Project-URL: Bug Reports, https://github.com/weaming/pretty-format-json
Project-URL: Source, https://github.com/weaming/pretty-format-json
Keywords: json format
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: oyaml
Requires-Dist: data-process>=0.3
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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)
