matrix-org / matrix-org/python-canonicaljson
Expose functions that return `str` instead of `bytes`
Open
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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