dvcurator.rename

Module Contents

Functions

project_name(citation)

Generate project name string, used in dropbox folder name and github project name

last_name_prefix(citation)

Extract the last name of the first author (and second) for filename prefix

add_filename_prefix(folder, prefix)

Add a prefix to all files in a folder

replace_spaces(folder)

Remove spaces in all filenames in a folder

remove_all_accents(folder)

Remove all accented characters in filenames in a folder

basic_rename(folder, citation)

Run a series of operations to properly format filenames in a folder according to QDR guidelines.

anonymize(folder, citation)

Anonymize the filenames, replacing names with ANONYMIZED

dvcurator.rename.project_name(citation)

Generate project name string, used in dropbox folder name and github project name

Parameters:

citation – Citation block generated by get_citation()

Returns:

String to use as the folder name or project name

Return type:

String

dvcurator.rename.last_name_prefix(citation)

Extract the last name of the first author (and second) for filename prefix

Parameters:

citation – Citation block generated by get_citation()

Returns:

String of last name (or other prefix if >1 author)

Return type:

String

dvcurator.rename.add_filename_prefix(folder, prefix)

Add a prefix to all files in a folder

Parameters:
  • folder (Path, as string) – Folder to rename files in

  • prefix (String) – Prefix to add to filenames

dvcurator.rename.replace_spaces(folder)

Remove spaces in all filenames in a folder

Parameters:

folder (Path, as string) – Folder to rename files in

dvcurator.rename.remove_all_accents(folder)

Remove all accented characters in filenames in a folder

Parameters:

folder (Path, as string) – Folder to rename files in

dvcurator.rename.basic_rename(folder, citation)

Run a series of operations to properly format filenames in a folder according to QDR guidelines. Add prefix, remove accents, replace spaces.

Parameters:
  • folder (Path, as string) – Folder to rename files in

  • citation – Citation block generated by get_citation()

Returns:

Path to the new folder with renamed files

Return type:

String

dvcurator.rename.anonymize(folder, citation)

Anonymize the filenames, replacing names with ANONYMIZED

Parameters:
  • folder (path, as string) – folder of the files to rename

  • citation – Citation block generated by get_citation()