dcase_util.containers.ListDictContainer
- class dcase_util.containers.ListDictContainer(*args, **kwargs)[source]
List of dictionaries container class inherited from standard list class.
Constructor
- Parameters
- filenamestr, optional
File path
Methods
__init__
(*args, **kwargs)Constructor
append
(object, /)Append object to the end of the 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
empty
()Check if file is empty
exists
()Checks that file exists
extend
(iterable, /)Extend list by appending elements from the iterable.
filter
([case_insensitive_fields])Filter content based on field values.
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.
is_package
([filename])Determine if the file is compressed package.
load
([filename, fields, csv_header, ...])Load file
log
([level])Log container content
pop
([index])Remove and return item at index (default last).
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 file
search
(key, value)Search in the list of dictionaries
show
([mode, indent, visualize])Print container content
sort
(*[, key, reverse])Sort the list in ascending order and return None.
to_html
([indent])Get container information in a HTML formatted string
to_string
([ui, indent])Get container information in a string
update
(data)Replace content with given list
validate_format
()Validate file format
Attributes
bytes
File size in bytes
logger
Logger instance
md5
Checksum for file.
valid_formats
Valid file formats