Reading and writing data#

See Loading and saving data. Eyelink files are usually read with EyeData.from_eyelink(), saved objects with from_file().

Files and URLs#

read_eyelink

Read an Eyelink file/URL and return the object returned by the "eyelinkio" package.

read_tobii_prolab

Read a data export of Tobii Pro Lab (recordings of Tobii Pro Glasses).

read_gazepoint

Read a recording of a GazePoint eye tracker (e.g., GP3).

read_file

Read a Python object from a file using pickle (or HDF5).

write_file

Store any Python object in a file using pickle (or HDF5).

download

Download a file from a URL to a local file.

fetch_url

Download an HTTP(S) or SSH URL to a local file, with caching.

local_copy

Context manager that gives a local filename for source.

OSF#

Files from OSF projects.

get_osf_project_files

Get all file IDs from an OSF project.

osf_authenticate

Authenticate against the OSF API using a personal access token.

figshare#

Files from figshare items (public, or private with a personal token).

get_figshare_files

List the files of a figshare item (public, or private with a token).

fetch_figshare_file

Download a file from a figshare item, with caching.

figshare_session

A requests session with a figshare personal token.

Datasets and studies#

Whole studies, pp.datasets; see Analysing a study and Open datasets.

list_datasets

The available datasets.

get

A dataset by name (see list_datasets()).

default_cache_dir

Where the remote dataset name is stored by default.

make_manifest

Write the manifest of a dataset (for adding a new dataset).

read_manifest

The files in a manifest (see make_manifest()).

Dataset

A study with many recordings: download, load and convert them.

PreprocessedDataset

A dataset with all recordings preprocessed.

Exclude

Exclude a recording while preprocessing it.

RobisonBrewer2022

Robison & Brewer (2022): pupil size of ~260 participants in three tasks.

RLMW

RLMW: reinforcement learning and mind wandering (EyeLink, 500 Hz).

Example datasets#

Single recordings for the tutorials.

get_available_datasets

Return available example datasets.

get_example_data

Load example data for a given example (see example_datasets).

get_rlmw_002

Load the "rlmw_002" example dataset (downloaded from OSF).

get_rlmw_002_short

Load the "rlmw_002_short" example dataset (included in the package).

get_rlmw_010_edf

Load the "rlmw_010_edf" example dataset (downloaded from OSF).

get_nback_001

Load the "nback_001" example dataset (downloaded from figshare).

get_robison_pxb

Load the "robison_pxb" example dataset (downloaded from OSF): a 3-minute baseline (fixation on a grey screen).

get_robison_pvt

Load the "robison_pvt" example dataset (downloaded from OSF): a 20-minute psychomotor vigilance task.

get_robison_cd

Load the "robison_cd" example dataset (downloaded from OSF): a 14-minute colour change detection task.