dcase_util.files.File
- class dcase_util.files.File(*args, **kwargs)[source]
Generic file class
Constructor
- Parameters
- filenamestr, optional
File path
- valid_formatslist of FileFormat items
List of valid formats (FileFormat) Default [YAML,JSON,CPICKLE,MARSHAL,MSGPACK,TXT,CSV,ZIP,TAR]
- __init__(*args, **kwargs)[source]
Constructor
- Parameters
- filenamestr, optional
File path
- valid_formatslist of FileFormat items
List of valid formats (FileFormat) Default [YAML,JSON,CPICKLE,MARSHAL,MSGPACK,TXT,CSV,ZIP,TAR]
Methods
__init__
(*args, **kwargs)Constructor
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 file information, filename
is_package
([filename])Determine if the file is compressed package.
load
([filename])Load file
save
(data[, filename])Save file
Validate file format
Attributes
bytes
File size in bytes
logger
md5
Checksum for file.
valid_formats