Use orjson when already installed or with speedups extra (#466)

* Use orjson when already installed

* Use orjson when already installed

* fix patch target

* fix patch target

* add speedups extra

* Update README.md

* Update README.md
This commit is contained in:
J. Nick Koston
2023-06-17 18:03:04 -05:00
committed by GitHub
parent 9550cbd2f7
commit 2d42ca301f
7 changed files with 1096 additions and 1005 deletions

15
kasa/json.py Executable file
View File

@@ -0,0 +1,15 @@
"""JSON abstraction."""
try:
import orjson
def dumps(obj, *, default=None):
"""Dump JSON."""
return orjson.dumps(obj).decode()
loads = orjson.loads
except ImportError:
import json
dumps = json.dumps
loads = json.loads