CreateExportInventories package

Submodules

LOGS_solutions.CreateExportEntities.CreateExportInventories.InventoryManager module

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

Bases: object

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

check_customtypes(customtype_set)[source]

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

Parameters:

customtype_set (Set) – Set with all custom types named in the csv file.

Return type:

None

Returns:

List of CustomType objects

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:

None

Returns:

List of Project objects

create_inventories()[source]

Creates inventories in the LOGS instance based on the data from the source CSV or Excel file.

Return type:

None

export_inventories()[source]

Exports inventories from the LOGS instance to a CSV or Excel file at the target path.

Return type:

None

export_inventories_csv()[source]

Exports inventories from the LOGS instance to a CSV file.

Return type:

None

export_inventories_excel()[source]

Exports inventories from the LOGS instance to an Excel file.

Return type:

None

export_inventories_json()[source]

Exports inventories from the LOGS instance to JSON files.

Return type:

None

post_process_data(inventories_data)[source]

Normalize empties, parse Projects list, parse Custom Type; drop bad rows. :type inventories_data: DataFrame :param inventories_data: DataFrame read from source file. :rtype: DataFrame :return: Post-processed DataFrame.

read_file()[source]

Reads the inventories from the given source file. :rtype: DataFrame :return: DataFrame with inventories data.

LOGS_solutions.CreateExportEntities.CreateExportInventories.main module

LOGS_solutions.CreateExportEntities.CreateExportInventories.main.main(args)[source]

Main function to create or export inventories 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 Create Inventories: Be aware that the csv/excel files must have the header

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

Parse command line arguments.

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

Validate the export format.

LOGS_solutions.CreateExportEntities.CreateExportInventories.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.CreateExportInventories.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.CreateExportInventories.main.validate_format(args)[source]

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

Module contents