What's the best way to use json dump in Python for clean data output? or How do I properly format a j

16 Replies, 1014 Views

If you’re tired of tweaking json dump python params every time, try `orjson`. It’s faster *and* has sensible defaults.

Install it with `pip install orjson`, then:
```python
import orjson
print(orjson.dumps(data).decode())
```

It handles unicode properly and doesn’t need `ensure_ascii=False`.

Messages In This Thread



Users browsing this thread: 1 Guest(s)