dcase_util.data.DataBuffer

class dcase_util.data.DataBuffer(size=10, **kwargs)[source]

Data buffer (First in, first out)

Buffer can store data and meta data associated to it.

__init__ method.

Parameters
sizeint

Number of item to store in the buffer Default value 10

__init__(size=10, **kwargs)[source]

__init__ method.

Parameters
sizeint

Number of item to store in the buffer Default value 10

Methods

__init__([size])

__init__ method.

clear()

Empty the buffer

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

get(key)

Get item based on key

get_file_information()

Get file information, filename

is_package([filename])

Determine if the file is compressed package.

key_exists(key)

Check that key exists in the buffer

load([filename])

Load file

log([level])

Log container content

save([filename])

Save file

set(key[, data, meta])

Insert item to the buffer

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

count

Buffer usage

full

Buffer full

logger

Logger instance

md5

Checksum for file.

valid_formats

Valid file formats