*Render the data in CSV format*

        **Key Arguments:**
            - ``filepath`` -- path to the file to write the csv content to. Default *None*

        **Return:**
            - ``renderedData`` -- the data rendered in csv format

        **Usage:**

            To render the data set as csv:

            .. code-block:: python

                print dataSet.csv()

            .. code-block:: text

                owner,pet,address
                daisy,dog,"belfast, uk"
                john,snake,the moon
                susan,crocodile,larne

            and to save the csv rendering to file:

            .. code-block:: python

                dataSet.csv("/path/to/myfile.csv")

def csv(
        self,
        filepath=None
    ):
        """*Render the data in CSV format*

        **Key Arguments:**
            - ``filepath`` -- path to the file to write the csv content to. Default *None*

        **Return:**
            - ``renderedData`` -- the data rendered in csv format

        **Usage:**

            To render the data set as csv:

            .. code-block:: python

                print dataSet.csv()

            .. code-block:: text

                owner,pet,address
                daisy,dog,"belfast, uk"
                john,snake,the moon
                susan,crocodile,larne

            and to save the csv rendering to file:

            .. code-block:: python

                dataSet.csv("/path/to/myfile.csv")
        """
        self.log.debug('starting the ``csv`` method')

        renderedData = self._list_of_dictionaries_to_csv("machine")

        if filepath and renderedData != "NO MATCH":

            # RECURSIVELY CREATE MISSING DIRECTORIES
            if not os.path.exists(os.path.dirname(filepath)):
                os.makedirs(os.path.dirname(filepath))

            writeFile = codecs.open(filepath, encoding='utf-8', mode='w')
            writeFile.write(renderedData)
            writeFile.close()

        self.log.debug('completed the ``csv`` method')
        return renderedData