pygeodes.utils.io#

This module regroups all functions related to file INPUT/OUTPUT

Functions

check_if_folder_already_contains_file(...)

The goal of this function is to check if, in the folder of the filepath provided, it already exists a file with the same checksum as the one provided, with in aim not to download several times the same file.

compute_md5(filepath)

Computes md5sum of the contents of the given filepath

file_exists(filepath[, raise_exception])

This checks if the file exists, and, in function of a boolean parameter, raises an exception if it doesn't

filename_in_folder(name, folder_path)

This functions checks if a filename is in a folder

filenames_respecting_regex(filenames, regex)

This functions find all the filenames in a list of filenames matching a given regex

find_unused_filename(filepath)

This functions finds an unused filename for the filepath provided by adding -{number} after

get_homedir()

To get the home directory path of the current user

load_json(filepath)

This functions loads a JSON into a Python dict from a filepath

similar_filenames(filename, other_filenames)

This function returns the nb most resembling filenames to the filename provided in the list of filenames

wrapped_default(self, obj)

write_json(content, filepath)

This functions dumps a dict at a filepath