dcase_util.containers.MetaDataContainer

class dcase_util.containers.MetaDataContainer(*args, **kwargs)[source]

Meta data container class, inherited from ListDictContainer.

Constructor

Parameters
filenamestr, optional

File path

__init__(*args, **kwargs)[source]

Constructor

Parameters
filenamestr, optional

File path

Methods

__init__(*args, **kwargs)

Constructor

add_time(time)

Add time offset to event onset and offset timestamps

append(item)

Append item to the meta data list

clear(/)

Remove all items from list.

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

delimiter([exclude_delimiters])

Use csv.sniffer to guess delimiter for CSV file

detect_file_format([filename])

Detect file format from extension

difference(second_metadata)

Difference of two meta containers

empty()

Check if file is empty

event_inactivity([event_label, ...])

Get inactivity segments between events as event list

event_stat_counts()

Event count statistics

exists()

Checks that file exists

extend(iterable, /)

Extend list by appending elements from the iterable.

filter([filename, file_list, scene_label, ...])

Filter content

filter_time_segment([start, stop, duration, ...])

Filter time segment

get_dump_content(data)

Clean internal content for saving

get_field(field_name[, skip_items_without_field])

Get all data from field.

get_field_unique(field_name)

Get unique data from field.

get_file_information()

Get file information, filename

index(value[, start, stop])

Return first index of value.

insert(index, object, /)

Insert object before index.

intersection(second_metadata)

Intersection of two meta containers

intersection_report(second_metadata)

Intersection report for two meta containers

is_package([filename])

Determine if the file is compressed package.

load([filename, fields, csv_header, ...])

Load event list from delimited text file (csv-formatted)

log([level, show_data, show_stats])

Log container content

log_all([level])

Log container content with all meta data items.

map_events(target_event_label[, ...])

Map events with varying event labels into single target event label

map_tags(target_tag[, source_tags])

Map tags with varying tags into single target tag

pop([index])

Remove and return item at index (default last).

process_events([minimum_event_length, ...])

Process event content

push_processing_chain_item(processor_name[, ...])

Push processing chain item

remove(value, /)

Remove first occurrence of value.

remove_field(field_name)

Remove field from data items

reverse(/)

Reverse IN PLACE.

save([filename, fields, csv_header, ...])

Save content to csv file

scene_stat_counts()

Scene count statistics

search(key, value)

Search in the list of dictionaries

show([mode, indent, show_info, show_data, ...])

Print container content

show_all([mode, indent])

Print container content with all meta data items.

sort(*[, key, reverse])

Sort the list in ascending order and return None.

stats([event_label_list, scene_label_list, ...])

Statistics of the container content

tag_stat_counts()

Tag count statistics

to_event_roll([label_list, time_resolution, ...])

Event roll

to_html([indent, show_info, show_data, ...])

Get container information in a HTML formatted string

to_string([ui, indent, show_info, ...])

Get container information in a string

update(data)

Replace content with given list

validate_format()

Validate file format

Attributes

bytes

File size in bytes

dataset_count

Number of unique dataset identifiers

event_count

Number of events

event_label_count

Number of unique event labels

file_count

Number of files

identifier_count

Number of unique identifiers

logger

Logger instance

max_offset

Find the offset (end-time) of last event

md5

Checksum for file.

scene_label_count

Number of unique scene labels

tag_count

Number of unique tags

unique_datasets

Unique datasets

unique_event_labels

Unique event labels

unique_files

Unique files

unique_identifiers

Unique identifiers

unique_scene_labels

Unique scene labels

unique_source_labels

Unique source labels

unique_tags

Unique tags

valid_formats

Valid file formats