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:
-
src
(str
) –Source URL path
-
dst
(PathLike
) –Destination file path
-
progress
(bool
, default:True
) –Display progress bar. Defaults to True.
Source code in neuralspot_edge/utils/file.py
compute_checksum
Compute checksum of file.
Parameters:
-
file
(Path
) –File path
-
checksum_type
(str
, default:'md5'
) –Checksum type. Defaults to "md5".
-
chunk_size
(int
, 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:
-
file
(str
) –File path (.pkl)
-
compress
(bool
, 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:
-
file
(str
) –File path (.pkl)
-
compress
(bool
, 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