file
File Utility API
This module provides utility functions to interact with files.
Functions:
-
download_file–Download file from supplied url to destination streaming
-
compute_checksum–Compute checksum of file
-
load_pkl–Load pickled file
-
save_pkl–Save python objects into pickle file
-
resolve_template_path–Resolve templated path w/ supplied substitutions
Functions
download_file
Download file from supplied url to destination streaming.
Parameters:
-
(srcstr) –Source URL path
-
(dstPathLike) –Destination file path
-
(progressbool, default:True) –Display progress bar. Defaults to True.
Source code in neuralspot_edge/utils/file.py
compute_checksum
Compute checksum of file.
Parameters:
-
(filePath) –File path
-
(checksum_typestr, default:'md5') –Checksum type. Defaults to "md5".
-
(chunk_sizeint, default:8192) –Chunk size. Defaults to 8192.
Returns:
-
str(str) –Checksum value
Source code in neuralspot_edge/utils/file.py
load_pkl
Load pickled file.
Parameters:
-
(filestr) –File path (.pkl)
-
(compressbool, default:True) –If file is compressed. Defaults to True.
Returns:
Source code in neuralspot_edge/utils/file.py
save_pkl
Save python objects into pickle file.
Parameters:
-
(filestr) –File path (.pkl)
-
(compressbool, default:True) –Whether to compress file. Defaults to True.
Source code in neuralspot_edge/utils/file.py
resolve_template_path
Resolve templated path w/ supplied substitutions.
Parameters:
Returns:
-
Path(Path) –Resolved file path