pyslk.list

Contents

pyslk.list#

pyslk.list(path_or_id: str | int | Path | list[str] | list[int] | list[pathlib.Path] | set[str] | set[int] | set[pathlib.Path], show_hidden: bool = False, numeric_ids: bool = False, recursive: bool = False, column_names: list = ['permissions', 'owner', 'group', 'filesize', 'day', 'month', 'year', 'time', 'filename'], parse_dates: bool = True, parse_sizes: bool = True, full_path: bool = True) <Mock name='mock.DataFrame' id='139757892385232'>#

Return pandas.DataFrame containing results from search id or GNS path

Calls list_raw() and parses the return string into a pandas.DataFrame. All arguments are copied 1:1 except for ‘column_widths’. Assumes six output columns of ‘slk list’ having the widths 12, 12, 12, 9, 4, 4, 5 and 999 (999 => as wide as necessary).

Note: list_raw() currently only print the modification date and no modification time. The output of this parser might be modified in future when modification times are printed as well.

Parameters:
  • path_or_id (str or Path or int) – search id or gns path

  • show_hidden (bool) – show ‘.’ files, default: False (don’t show these files)

  • numeric_ids (bool) – show numeric values for user and group, default: False (show user and group names)

  • recursive (bool) – use the -R flag to list recursively, default: False

  • column_names (list) – names of the columns in the pandas.DataFrame

  • parse_dates (bool) – parse day, month and year into a datetime column.

  • parse_sizes (bool) – parse ‘filesize’ column into bytes integer.

  • full_path (bool) – add full filepath to filename column.

Returns:

output of ‘slk list’ parsed into a pandas.DataFrame with eight columns (permissions, owner, group, size, day, month, year, filename)

Return type:

pandas.DataFrame

See also