I am trying to validate the dictionary parameter.
import logging
import os
# decorator
def file_validator(f):
    def wrapped(*args):
        """
        Once there is passed values,
        file_path = os.path.join(path_info, file_info)
        if os.path.exists(file_path):
            logging.info('{} exists'.format(file_info))
        else:
            logging.info('{} does not exist'.format(file_info))
        """
# original function
@file_validator
def original_function(file_dict):
    # pass only specific element to file_validator decorator for checking
    # for example only "pathA": "/files", "fileA": "bar.csv"
sample_dict = {"pathA": "/files", "fileA": "bar.csv", "fileB": "hello.txt"}
original_function(sample_dict)
Is there a way to check this way using decorator?
EDIT
This could be equivalent to what I want to do.
def file_validator(filepath, filename):
    file_path = os.path.join(filepath + filename)
    if os.path.exists(file_path):
        logging.info('{} exists'.format(filename))
    else:
        logging.info('{} does not exist'.format(filename))
def original_function(file_dict):
    file_validator(file_dict['pathA'], file_dict['fileA'])
    file_validator(file_dict['pathA'], file_dict['fileB'])
sample_dict = {"pathA": "/files", "fileA": "bar.csv", "fileB": "hello.txt"}
original_function(sample_dict)
 
     
    