pyschema/core.py
def from_json_compatible(schema, dct):
    "Load from json-encodable"
    kwargs = {}

    for key in dct:
        field_type = schema._fields.get(key)
        if field_type is None:
            raise ParseError("Unexpected field encountered in line for record %s: %s" % (schema.__name__, key))
        kwargs[key] = field_type.load(dct[key])

    return schema(**kwargs)
def from_json_compatible(schema, dct):
    "Load from json-encodable"
    kwargs = {}

    for key in dct:
        field_type = schema._fields.get(key)
        if field_type is None:
            raise ParseError("Unexpected field encountered in line for record %s: %s" % (schema.__name__, key))
        kwargs[key] = field_type.load(dct[key])

    return schema(**kwargs)
def from_json_compatible ( schema , dct ) : kwargs = { } for key in dct : field_type = schema . _fields . get ( key ) if field_type is None : raise ParseError ( "Unexpected field encountered in line for record %s: %s" % ( schema . __name__ , key ) ) kwargs [ key ] = field_type . load ( dct [ key ] ) return schema ( * * kwargs )
Load from json-encodable
Load from json - encodable