Utils¶
Utils module¶
Collection of helper functions.
-
urduhack.utils.
pickle_load
(file_name: str) → Any[source]¶ Load the pickle file
Parameters: file_name (str) – file name Returns: python object type Return type: Any
-
urduhack.utils.
pickle_dump
(file_name: str, data: Any)[source]¶ Save the python object in pickle format
Parameters: - file_name (str) – file name
- data (Any) – Any data type
-
urduhack.utils.
download_from_url
(file_name: str, url: str, download_dir: str, cache_dir: Optional[str] = None)[source]¶ Download anything from HTTP url
Parameters: Raises: TypeError
– If any of the url, file_path and file_name are not str Type.
-
urduhack.utils.
remove_file
(file_name: str)[source]¶ Delete the local file
Parameters: file_name (str) – File to be deleted
Raises: TypeError
– If file_name is not str Type.FileNotFoundError
– If file_name does not exist