dcase_util.data.RepositoryNormalizer

class dcase_util.data.RepositoryNormalizer(normalizers=None, filename=None, **kwargs)[source]

Data repository normalizer

__init__ method.

Parameters
normalizersdict

Normalizers in a dict to initialize the repository, key in the dictionary should be the label Default value None

filenamestr or dict

Either one filename (str) or multiple filenames in a dictionary. Dictionary based parameter is used to construct the repository from separate Normalizer, format: label as key, and filename as value. Default value None

__init__(normalizers=None, filename=None, **kwargs)[source]

__init__ method.

Parameters
normalizersdict

Normalizers in a dict to initialize the repository, key in the dictionary should be the label Default value None

filenamestr or dict

Either one filename (str) or multiple filenames in a dictionary. Dictionary based parameter is used to construct the repository from separate Normalizer, format: label as key, and filename as value. Default value None

Methods

__init__([normalizers, filename])

__init__ method.

accumulate(data)

Accumulate statistics

delimiter([exclude_delimiters])

Use csv.sniffer to guess delimiter for CSV file

detect_file_format([filename])

Detect file format from extension

empty()

Check if file is empty

exists()

Checks that file exists

finalize()

Finalize statistics calculation

get_file_information()

Get file information, filename

is_package([filename])

Determine if the file is compressed package.

load(filename[, collect_from_containers])

Load normalizers from disk.

log([level])

Log container content

normalize(data, **kwargs)

Normalize data repository

reset()

Reset normalizers.

save([filename, split_into_containers])

Save file

show([mode, indent, visualize])

Print container content

to_html([indent])

Get container information in a HTML formatted string

to_string([ui, indent])

Get container information in a string

validate_format()

Validate file format

Attributes

bytes

File size in bytes

logger

Logger instance

md5

Checksum for file.

valid_formats

Valid file formats