Skip to main content

JSONSerializer

Simple wrapper around json to be used in signing.dumps and signing.loads.

Methods


dumps()

@classmethod
def dumps(
obj: object
) - > bytes

Serializes a Python object into a compact JSON byte string encoded in latin-1.

Parameters

NameTypeDescription
objobjectThe Python object to be serialized into a JSON format.

Returns

TypeDescription
bytesA latin-1 encoded byte string containing the JSON representation of the object with no whitespace separators.

loads()

@classmethod
def loads(
data: bytes
) - > object

Deserializes a latin-1 encoded byte string containing JSON data back into a Python object.

Parameters

NameTypeDescription
databytesThe latin-1 encoded byte string containing the JSON data to be parsed.

Returns

TypeDescription
objectThe Python object representation of the decoded JSON data.