CreateExportSamples package

Submodules

LOGS_solutions.CreateExportEntities.CreateExportSamples.SampleManager module

class LOGS_solutions.CreateExportEntities.CreateExportSamples.SampleManager.SampleManager(logs, source_path=None, target_path=None, export_format='.csv')[source]

Bases: object

This class enables the creation of samples in a LOGS instance using a CSV file, or the export of samples from a LOGS instance into a CSV file.

check_persons(person_set)[source]

Checks for each person in the person set whether they exist in the LOGS instance.

Parameters:

person_set (Set) – Set with all persons named in the csv file.

Return type:

List[Person]

check_projects(project_set)[source]

Checks for each project in the project set whether they exist in the LOGS instance.

Parameters:

person_set – Set with all projects named in the csv file.

Return type:

List[Project]

Returns:

List of Project objects

create_attribute_list(attribute_str, attr_obj_list, check_person=False)[source]

Creates a list of attributes.

Parameters:
  • attribute_str (str) – List of attributes of one class type

  • attribute_class – Class of the attributes

  • check_person (bool) – Should be True, if the attr_obj_list is a list of persons

Return type:

List

Returns:

List of all attributes in attribute_str.

create_samples()[source]

Creates a sample by the given csv-file.

export_samples()[source]

Exports samples from the LOGS instance to a CSV file or Excel file.

export_samples_csv()[source]

Export Samples from logs.

export_samples_excel()[source]

Export Samples from logs to an excel file.

LOGS_solutions.CreateExportEntities.CreateExportSamples.main module

LOGS_solutions.CreateExportEntities.CreateExportSamples.main.main(args=None)[source]

Main function to create or export samples in a LOGS instance. Important: This classes uses absolute paths. To obtain the correct absolute path, you must ensure that the relative path is correct in relation to the directory in which the script is executed. If you are not sure, use the absolute path for source_path and target_path

LOGS_solutions.CreateExportEntities.CreateExportSamples.main.parse_args()[source]

Parse command line arguments.

LOGS_solutions.CreateExportEntities.CreateExportSamples.main.valid_format(value)[source]

Validate the export format.

LOGS_solutions.CreateExportEntities.CreateExportSamples.main.valid_source_path(source_path)[source]

Validates the given source paths.

Parameters:

source_path – The source path to validate.

Return type:

Path

Returns:

The absolute path for the source.

LOGS_solutions.CreateExportEntities.CreateExportSamples.main.valid_target_path(target_path)[source]

Validates the given paths.

Parameters:

target_path – The target path to validate.

Return type:

Path

Returns:

The absolute path for the target.

LOGS_solutions.CreateExportEntities.CreateExportSamples.main.validate_format(args)[source]

Validate the export format and ensure it matches the target paths.

Module contents