How to use the jsonlib.read function in jsonlib

To help you get started, we’ve selected a few jsonlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pythonanywhere / dirigible-spreadsheet / python / dirigible / sheet / worksheet.py View on Github external
def worksheet_from_json(json_string):
    #use jsonlib for read ops because of better performance
    #keep simplejson for write ops as it's more robust
    worksheet_dict = jsonlib.read(json_string)
    worksheet = Worksheet()
    for (key, value) in worksheet_dict.iteritems():
        if key == "_console_text":
            worksheet._console_text = value
        elif key == "_usercode_error":
            worksheet._usercode_error = value
        else:
            col_str, row_str = key.split(",")
            cell = Cell()
            cell._formula = value["formula"]
            cell._python_formula = value.get("python_formula")
            cell.dependencies = map(tuple, value.get("dependencies", []))
            cell.error = value.get("error")
            cell._value = value.get("value", undefined)
            cell.formatted_value = value["formatted_value"]
            worksheet[int(col_str), int(row_str)] = cell
github andreyto / mgtaxa / MGT / TaxaIO.py View on Github external
def load(self):
        import jsonlib
        inp = openCompressed(self.fileName,"rb")
        #nodes = json.loads(buf,object_hook=lambda o: TaxaNode(**o) if "idpar" in o else o)
        #return dict( ((node.id,node) for node in nodes) )
        nodes = {}
        for line in inp:
            node = jsonlib.read(line.strip(),use_float=True)
            nodes[node["id"]] = TaxaNode(**node)
        inp.close()
        return nodes
github turian / common / json.py View on Github external
    def fastloadfile(filename): return jsonlib.read(myopen(filename).read(), use_float=True)
    def fastload(file): return jsonlib.read(file.read(), use_float=True)
github turian / common / json.py View on Github external
    def fastloads(str): return jsonlib.read(str, use_float=True)
    fastdumps = jsonlib.write
github turian / common / json.py View on Github external
    def fastload(file): return jsonlib.read(file.read(), use_float=True)
except:
github andreyto / mgtaxa / MGT / TaxaIO.py View on Github external
def load(self):
        import jsonlib
        inp = openCompressed(self.fileName,"rb")
        buf = inp.read()
        inp.close()
        #nodes = json.loads(buf,object_hook=lambda o: TaxaNode(**o) if "idpar" in o else o)
        #return dict( ((node.id,node) for node in nodes) )
        data = jsonlib.read(buf,use_float=True)
        data["nodes"] = dict( ((node["id"],TaxaNode(**node)) for node in data["nodes"]) )
        data["merged"] = dict( (item for item in data["merged"]) )
        return data

jsonlib

JSON serializer/deserializer for Python

GPL-3.0
Latest version published 15 years ago

Package Health Score

43 / 100
Full package analysis

Similar packages