pavlov99/json-rpc · jsonrpc2.py
python logo
def from_json(cls, json_str):
        data = cls.deserialize(json_str)
        return cls.from_data(data)
Similar code snippets
1.
AirtestProject/Poco · utils.py
Match rating: 80.62% · See similar code snippets
python logo
def from_json(cls, json_str):
        data = cls.deserialize(json_str)

        if not isinstance(data, dict):
            raise ValueError("data should be dict")

        return cls(**data)
2.
AirtestProject/Poco · exceptions.py
Match rating: 74.25% · See similar code snippets
python logo
def from_json(cls, json_str):
        data = cls.deserialize(json_str)
        return cls(
            code=data["code"], message=data["message"], data=data.get("data"))
3.
GoogleCloudPlatform/appengine-mapreduce · json_util.py
Match rating: 71.46% · See similar code snippets
python logo
def from_json_str(cls, json_str):
    """Convert json string representation into class instance.

    Args:
      json_str: json representation as string.

    Returns:
      New instance of the class with data loaded from json string.
    """
    return cls.from_json(json.loads(json_str, cls=JsonDecoder))
4.
i3visio/osrframework · utils.py
Match rating: 70.78% · See similar code snippets
python logo
def from_json(cls, json_str):
        """Deserialize the object from a JSON string."""
        d = json.loads(json_str)
        return cls.from_dict(d)
5.
GoogleCloudPlatform/appengine-mapreduce · input_readers.py
Match rating: 65.53% · See similar code snippets
python logo
def from_json(cls, json):
    return cls(json[cls.COUNT], json[cls.STRING_LENGTH])
6.
cfhamlet/os-config · config.py
Match rating: 64.4% · See similar code snippets
python logo
def from_json(cls, j):
        d = json.loads(j)
        return cls.from_dict(d)
7.
bunq/sdk_python · converter.py
Match rating: 64.11% · See similar code snippets
python logo
def json_to_class(cls, json_str):
    """
    :type cls: T|type
    :type json_str: str

    :rtype: T
    """

    obj_raw = json.loads(json_str)

    return deserialize(cls, obj_raw)
8.
Stranger6667/postmarker · base.py
Match rating: 61.68% · See similar code snippets
python logo
def from_json(cls, json, manager=None):
        data = loads(json)
        return cls(manager=manager, **data)
9.
vladcalin/gemstone · structs.py
Match rating: 60.81% · See similar code snippets
python logo
def from_string(cls, string):
        try:
            return cls.from_dict(json.loads(string))
        except json.JSONDecodeError:
            raise JsonRpcParseError()
10.
poppy-project/pypot · move.py
Match rating: 60.5% · See similar code snippets
python logo
def loads(cls, str):
        """ Loads a :class:`~pypot.primitive.move.Move` from a json string. """
        d = json.loads(str)
        return cls.create(d)