FileHandler

        
            from EasyFileHandling.main import FileHandler
        
      

does_file_exist(self)

Returns: bool

Description: As name itself describes it, it returns True if file exists and returns False if file doesn't exists.

get_file_content(self)

Returns: str

Description:Returns all content in file

get_line_count(self)

Returns: Union[str, int]

Description: Returns number of lines in the file

get_longest_line(self)

Returns: str

Description: Returns longest line length and line indices of lines with that length

change_file_content(self, new_content: Union[str, bytes, bytearray])

Returns:None

DescriptionChanges whole file content

add_something_to_file_content(self, content: Union[str, bytes])

Returns: None

Description: Appends content to end of the file!

what_type_of_file(self)

Returns: str

Description: Tells you what type of file is it.

change_file_extension(self, current_extension: str, new_extension: str)

Returns: str

Description: Changes file extension

is_file_writeable(self)

Returns: bool

Description: Tells you if file is writeable

JsonHandler

                
                    from EasyFileHandling.jsonHandler import JsonHandler
                
              

write_to_json(self, obj: Union[dict, list])

Returns: None

Description: Writes to json file

append_to_json(self, obj: Union[dict, list])

Returns: None

Description: Appends to json file

read_json_file(self) -> Union[dict, list]

Returns: Union[dict, list]

Description: Reads the the JSON file and returns that data in python data structures

Side Funcations

change_file_name(path: str, new_name: str)

Returns: None

Description: Changes file name

create_file(file: str)

Returns: Union[str, bool, None]

Description: Creates a file

delete(file: str)

Returns: Union[str, None]

Description: Deletes file

list_item_in_dir(path)

Returns: list

Description: Gives a list of all items in the folder

delete_all_item_in_dict(path: str)

Returns: list

Description: Deletes all items in the folder

is_pythonfile(file: str)

Returns: bool

Description: Returns True if file extension is py and if not then false.

ImageHandler

                
                    from EasyFileHandling.imagehandler import ImageHandler
                
              

filter_image(self, option)

Returns: None

Description: Applies filters on the image

Options: 'blur', 'contour', 'detail', 'edge_enhance', 'emboss', 'edge_enhance_more', 'find_edges', 'sharpen', 'smooth', 'smooth_more'

draw_text(x, y, text: str, fontsize: int, rgb=(0, 0, 0), font="arial.ttf")

Returns: None

Description: Adds text onto the image