Metadata-Version: 2.4
Name: pyfracturedjson
Version: 2.2.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
License-File: LICENSE
Summary: A compact yet readable JSON formatter
Keywords: json,formatter,fracturedjson,compact,readable
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/g-b-f/pyFracturedJSON/blob/master/CHANGELOG.md
Project-URL: Repository, https://github.com/g-b-f/pyFracturedJSON

# pyFracturedJSON

Adds [FracturedJSON](https://github.com/j-brooke/FracturedJson) support to python,
allowing you to create JSON that is both compact and readable.


You can trivially use it as a drop-in replacement for the built-in `json` module:

```python
import fracturedjson as json

long_list = [f"thing_{i}" for i in range(20)]
data = {"abcd": "abcd", "long_list": long_list}

print(json.dumps(data))
print(json.dumps(data, line_length=50))
print(json.dumps(data, indent=2))

with open("file.json", "w") as f:
    json.dump(data, f)

with open("file.json") as f:
    json.load(f)

json.loads('{"foo":"bar"}')
```

Or, if you'd prefer:

```python
import json
from fracturedjson import Encoder

long_list = [f"thing_{i}" for i in range(20)]
data = {"abcd": "abcd", "long_list": long_list}

print(json.dumps(data, cls=Encoder))
print(json.dumps(data, cls=Encoder, line_length=50))
print(json.dumps(data, cls=Encoder, indent=2))

with open("file.json", "w") as f:
    json.dump(data, f, cls=Encoder)
```

This is largely a wrapper around [fracturedjson-rs](https://github.com/fcoury/fracturedjson-rs),
so credit to the creator.
