pysoftk.folder_manager package

Submodules

pysoftk.folder_manager.folder_creator module

class pysoftk.folder_manager.folder_creator.Fld[source]

Bases: object

Create folders automatically to be used as stand-alone application or along PySoftK.

copy_dir(source, destination)[source]

Function to copy files to directories.

Parameters:
  • source (str) – Source path where the files is located.

  • destination (str) – Source path where the directory is located.

Returns:

Creates a folder with a provided name.

Return type:

None

create(times=None, fixed_names=None)[source]

Function to create folders in the current working directory.

Parameters:
  • times (int, optional) – Number of times that a folder will be created

  • fixed_names (np.ndarray, optional) – Array of fixed names for the folders

Returns:

Creates folders with provided names.

Return type:

None

file_to_dir(format_extension, num_cores=None, fixed_names=None)[source]

Function to move files to directories in parallel

Parameters:
  • format_extension (str) – Format extension used to seek.

  • num_cores (int, optional) – Number of cores to be used.

  • fixed_names (np.ndarray, optional) – Array of fixed names for the folders

  • Results

  • -------

  • None – Move files to directories.

Raises:

NotImplementedError – Folders can not be created.

fxd_name(testname, times)[source]

Create an array of fixed names for folders.

Parameters:
  • testname (str) – Base name to be used as name

  • times (int) – Number of folders to create

Returns:

An array of names for folders

Return type:

np.ndarray

move_files_to_folder(file_extension, folder_name, num_cores=None)[source]

Moves all files with the given extension into a new folder with the specified name, using parallel processing.

Parameters:
  • file_extension (str) – The extension of the files to move (e.g., “txt”, “csv”, “pdf”).

  • folder_name (str) – The name of the folder to create and move the files into.

  • num_cores (int, optional) – The number of CPU cores to use for parallel processing. Defaults to None, which uses the number of available cores.

Return type:

None

seek_files(format_extension)[source]

Function to seek files in the current working directory.

Parameters:

format_extension (str) – Extension used to seek in the current working directory

Returns:

inp_name

Return type:

str

Module contents