ProfileManager

class profiles.profilemanager.ProfileType(value)

Different profile types

UNKNOWN = 'UNKNOWN'
DATETIME_LIST = 'DATETIME_LIST'
CSV = 'CSV'
EXCEL = 'EXCEL'
class profiles.profilemanager.ProfileManager(source_profile=None)

Represents a generic (set of) profile(s). Can be converted into ESDL profiles.

__init__(source_profile=None)
convert(source)

Copies all data from one profile instance to another. Is used when creating an InfluxDBProfile from an ExcelProfile.

Parameters:

source – source profile where the data is copied from

clear_profile()

Clears all profile information.

set_profile(profile_header, profile_data_list, profile_type: ProfileType)

Sets the profile information

Parameters:
  • profile_header – a list with column names, the first column is always the datetime column and also called ‘datetime’ (if you specify a different name, it’s replaced by ‘datetime’)

  • profile_data_list – a list of lists with values, the first item in the list must be of type datetime

  • profile_type – the type of the profile

load_csv(file_path, encoding: str = 'utf-8-sig')

Reads profile data out of a CSV file.

Parameters:
  • file_path – the path to the CSV file

  • encoding – the used encoding in the CSV file (utf-8-sig by default)

parse_esdl(esdl_profile)

Parses an ESDL profile and loads the data

Parameters:

esdl_profile – the ESDL profile object

get_profile_name_index(profile_name)

Calculates the index of the column in the profile data array based on the column name

Parameters:

profile_name – the name of the profile

Returns:

the index of the column in the profile data array

get_esdl_datetime_profile(profile_name=None)

Generates an esdl.DateTimeProfile from the loaded profile information

Parameters:

profile_name – the name of the profile (only necessary when multiple columns have been loaded)

Returns:

the esdl.DateTimeProfile

get_esdl_timeseries_profile(profile_name=None)

Generates an esdl.TimeSeriesProfile from the loaded profile information

Parameters:

profile_name – the name of the profile (only necessary when multiple columns have been loaded)

Returns:

the esdl.TimeSeriesProfile

exception profiles.profilemanager.NoProfileLoadedExecption

Thrown when no profile information is loaded

exception profiles.profilemanager.UnknownProfileNameException

Thrown when an unknown profile name is given

exception profiles.profilemanager.DuplicateValueInProfileException

Thrown when input data for a profile contains duplicate datetime values, probably due to a timezone error with daylight saving

exception profiles.profilemanager.UnsupportedProfileInputDataException

Thrown when input data for a profile is not recognized