cellyzer/io.py
def to_json(dataset_object, filename):
    """
    Write dataset object to a json file
    :param dataset_object: dataset object created
    :param filename: name of the dataset file
    :return: None
    """
    instance_type = type(dataset_object).__name__
    if instance_type != "CallDataSet" and instance_type != "MessageDataSet" and instance_type != "CellDataSet":
        raise TypeError
    elif type(filename) != str:
        raise TypeError
    else:
        print("[x]  Writing to JSON file ...")

        if '.JSON' or '.json' not in filename:
            filename = filename + '.json'

        i = 0
        records = dataset_object.to_dict()
        obj_dict = OrderedDict([('Record:' + str(records.index(obj)), obj) for obj in records])

        with open(filename, 'w') as f:
            f.write(dumps(obj_dict, indent=4, separators=(',', ': ')))

        print("Successfully exported {} object(s) to {}".format(len(records),
                                                                filename))

    Write dataset object to a json file
    :param dataset_object: dataset object created
    :param filename: name of the dataset file
    :return: None
    
Write dataset object to a json file
Write dataset object to a json file
def to_json(dataset_object, filename):
    instance_type = type(dataset_object).__name__
    if instance_type != "CallDataSet" and instance_type != "MessageDataSet" and instance_type != "CellDataSet":
        raise TypeError
    elif type(filename) != str:
        raise TypeError
    else:
        print("[x]  Writing to JSON file ...")
        if '.JSON' or '.json' not in filename:
            filename = filename + '.json'
        i = 0
        records = dataset_object.to_dict()
        obj_dict = OrderedDict([('Record:' + str(records.index(obj)), obj) for obj in records])
        with open(filename, 'w') as f:
            f.write(dumps(obj_dict, indent=4, separators=(',', ': ')))
        print("Successfully exported {} object(s) to {}".format(len(records),
                                                                filename))
def to_json ( dataset_object , filename ) : instance_type = type ( dataset_object ) . __name__ if instance_type != "CallDataSet" and instance_type != "MessageDataSet" and instance_type != "CellDataSet" : raise TypeError elif type ( filename ) != str : raise TypeError else : print ( "[x]  Writing to JSON file ..." ) if '.JSON' or '.json' not in filename : filename = filename + '.json' i = 0 records = dataset_object . to_dict ( ) obj_dict = OrderedDict ( [ ( 'Record:' + str ( records . index ( obj ) ) , obj ) for obj in records ] ) with open ( filename , 'w' ) as f : f . write ( dumps ( obj_dict , indent = 4 , separators = ( ',' , ': ' ) ) ) print ( "Successfully exported {} object(s) to {}" . format ( len ( records ) , filename ) )
Write dataset object to a json file
Write dataset object to a json file
"""
    Write dataset object to a json file
    :param dataset_object: dataset object created
    :param filename: name of the dataset file
    :return: None
    """
None
dataset_object
dataset object created
dataset object created
filename
name of the dataset file
name of the dataset file