When triggered the resource which can either be uploaded or linked
        to will be parsed and analysed to see if it possibly is a budget
        data package resource (checking if all required headers and any of
        the recommended headers exist in the csv).

        The budget data package specific fields are then appended to the
        resource which makes it useful for export the dataset as a budget
        data package.

def before_create(self, context, resource):
        """
        When triggered the resource which can either be uploaded or linked
        to will be parsed and analysed to see if it possibly is a budget
        data package resource (checking if all required headers and any of
        the recommended headers exist in the csv).

        The budget data package specific fields are then appended to the
        resource which makes it useful for export the dataset as a budget
        data package.
        """

        # If the resource is being uploaded we load the uploaded file
        # If not we load the provided url
        if resource.get('upload', '') == '':
            self.data.load(resource['url'])
        else:
            self.data.load(resource['upload'].file)

        self.generate_budget_data_package(resource)