Module eyekit.io
Functions for reading and writing data.
Functions
def read(file_path)-
Read in a JSON file.
FixationSequenceandTextBlockobjects are automatically decoded and instantiated. def write(data, file_path, compress=True)-
Write arbitrary data to a JSON file. If
compressisTrue, the file is written in the most compact way; ifFalse, the file will be larger but more human-readable.FixationSequenceandTextBlockobjects are automatically serialized. def import_asc(file_path, trial_begin_var, trial_begin_vals, extract_vars=[])-
Import a single ASC file or a directory of ASC files. The importer looks for a
trial_begin_varthat is set to one of thetrial_begin_vals, and then extracts allEFIXlines that occur within the subsequentSTART–ENDblock. Optionally, you can specify other variables that you want to extract, resulting in imported data that looks like this:{ "trial_0" : { "trial_type" : "Experimental", "passage_id" : "passage_a", "response" : "yes", "fixations" : FixationSequence[[368, 161, 208], ..., [562, 924, 115]] } }