def write(self, fmt='csv', outputdir=None, timestamp=None):
        try:
            fmt_method = getattr(self, 'write_' + fmt) 
        except AttributeError:
            raise UnsupportedFormatError("Format %s is not supported" % (fmt))
        
        if outputdir is None:
            outputdir = self.default_outputdir()

        if not os.path.exists(outputdir):
            os.makedirs(outputdir)

        if timestamp is None:
            timestamp = datetime.now()

        return fmt_method(outputdir, timestamp)
Writes collected data to a file.
dataset/ETHPy150Open openelections/openelections-core/openelex/base/bake.py/BaseBaker.write