pymovements.Participants.load#

static Participants.load(path: Path | str, metadata: Path | str | dict[str, Any] | None = None, *, separator: str = '\t', rename: dict[str, str] | None = None, read_csv_kwargs: dict[str, Any] | None = None, metadata_encoding: str = 'utf-8') Participants[source]#

Load participant data from participant files.

Parameters:
  • path (Path | str) – If this points to a directory, assume file with name participants.tsv inside that directory.

  • metadata (Path | str | dict[str, Any] | None) – Additional metadata. Can be directly passed as a dictionary. If path or string: load metadata from json file. If a relative path given, path is assumed to be relative to parent of path. If None: check for path parent directory for existing participants.json and load metadata if available. (default: None)

  • separator (str) – Separator in the tabular data file. (default: \t)

  • rename (dict[str, str] | None) – Rename columns according to mapping in dictionary. (default: None)

  • read_csv_kwargs (dict[str, Any] | None) – Pass these additional keyword arguments to polars.read_csv(). Takes precedence over the separator argument. (default: None)

  • metadata_encoding (str) – Use this encoding for writing the metadata json file. (default: utf-8)

Returns:

Participants initialized with data from loaded files.

Return type:

Participants