thypad / bovespa

Python package that reads the historical quote files from BM&FBovespa (Brazillian Stock Exchange)
MIT License
124 stars 35 forks source link

Parâmetro faltando na função on to_csv() #7

Open fernandofsilva opened 4 years ago

fernandofsilva commented 4 years ago

No arquivo record.py está faltando o parâmetro stock_code=None, isso causa um erro quando tenta exportar para Csv.

    def to_csv(self, outpath):
        with open(outpath, 'w') as csvfile:
            fieldnames = layout.stockquote.keys()
            writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
            writer.writeheader()

            for rec in self.records:
                if rec.stock_code == stock_code or stock_code is None:
                    writer.writerow(dict(rec.info))