def export_transactions(self, transactions):

        response = HttpResponse(content_type='text/csv')
        response[
            'Content-Disposition'] = 'attachment; filename=Transactions_%s.csv' % datetime.date.today().isoformat()

        writer = csv.writer(response)
        headers = ['name', 'source', 'target', 'liability',
                   'category', 'account', 'datetime', 'value', 'details']
        writer.writerow(headers)
        for transaction in transactions:
            row = [transaction, transaction.source, transaction.target, transaction.liability, transaction.category,
                   transaction.account, transaction.datetime, transaction.get_relative_value(), transaction.details]
            writer.writerow(row)
        return response
Export transactions into CSV file
dataset/ETHPy150Open treeio/treeio/treeio/finance/csvapi.py/ProcessTransactions.export_transactions