matrix-org / matrix-org/python-canonicaljson

Expose functions that return `str` instead of `bytes`

Open
#63 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
30
Forks
15
PR merge metrics
No merged PRs in 30d

Description

It would be nice to get canonical json as str, as a drop-in replacement for `json.dumps`. Right now using `encode_canonical_json` for that means going back and forth between str and bytes which is wasteful.
Thanks!

Contributor guide

Open the contributing guide

Research direction

Start by locating the encode_canonical_json entry point and compare its bytes result with json.dumps, which returns str. Add the requested str-returning API and verify that canonical JSON output is available without a str/bytes conversion; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.