td.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:beansoup 作者: fxtlabs 项目源码 文件源码
def parse_row(self, row, lineno):
        """Parse a row of a TD Canada Trust CSV file.

        Args:
          row: A list of field values for the row.
          lineno: The line number where the row appears in the CSV file
        Returns:
          A beansoup.importers.csv.Row object.
        """
        if len(row) != 5:
            raise csvlib.Error('Invalid row; expecting 5 values: {}'.format(row))
        date = datetime.datetime.strptime(row[0], '%m/%d/%Y').date()
        description = row[1]
        amount = -D(row[2]) if row[2] else D(row[3])
        balance = self.account_sign * D(row[4])
        return csv.Row(lineno, date, description, amount, balance)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号