dvcurator.fs

Module Contents

Functions

check_dropbox(dropbox[, project_name])

Check whether the specified dropbox folder is accessible

recursive_scan(path)

List all files in folder, recursively. Used to generate file list in README

current_step(folder)

Find latest (highest numbered) step in the "QDR Prepared" subfolder, i.e. "4_metadata"

copy_new_step(folder, step)

Copy QDR Prepared latest step (i.e. 3_rename) to a new step (i.e. 4_metadata), incrementing step number

anonymize_project(folder, citation)

Run full anonymization routine. Calls anon routine for filenames and PDF metadata

dvcurator.fs.check_dropbox(dropbox, project_name=None)

Check whether the specified dropbox folder is accessible

Parameters:
  • dropbox (path as a string) – Path to dropbox folder

  • project_name (String) – Project name to check if there is an existing folder in dropbox

dvcurator.fs.recursive_scan(path)

List all files in folder, recursively. Used to generate file list in README

Parameters:

path (Path as string) – Path to folder

Returns:

Pretty-printed recursive file list

Return type:

String

dvcurator.fs.current_step(folder)

Find latest (highest numbered) step in the “QDR Prepared” subfolder, i.e. “4_metadata”

Parameters:

folder (Path, as string) – Folder to check, should be path to “QDR Prepared” folder

Returns:

Path to subfolder with highest number, or None in case of error

Return type:

Path as a string, or None

dvcurator.fs.copy_new_step(folder, step)

Copy QDR Prepared latest step (i.e. 3_rename) to a new step (i.e. 4_metadata), incrementing step number

Parameters:
  • folder (Path, as string) – “QDR Prepared” folder

  • step (String) – Short description of next step, e.g. “metadata” or “rename”

Returns:

Path to newly created folder

Return type:

String

dvcurator.fs.anonymize_project(folder, citation)

Run full anonymization routine. Calls anon routine for filenames and PDF metadata

Parameters:

folder (path, as string) – Project folder

:param citation Dataverse citation :return: Path to new folder :rtype: string