glourencoffee / pycvm

Python library for processing data from CVM
MIT License
2 stars 0 forks source link

Error while reading FCA documents: "got empty string at field 'Cidade'" #4

Closed glourencoffee closed 2 years ago

glourencoffee commented 2 years ago

Description

Calling the function fca_reader() shows the error message "got empty string at field 'Cidade'".

Steps to reproduce

  1. Download the FCA of 2017
  2. Read documents from that FCA file by calling cvm.csvio.fca_reader()
  3. See error messages

Expected behavior

No errors are shown if fields such as 'Cidade' have an empty string.

Actual behavior

Errors are shown if some fields get an empty string.

Additional context

Here's a simple program that shows it:

import cvm

for fca in cvm.csvio.fca_reader('/path/to/fca/2017.zip'):
    print(fca.company_name)

The output is:

BCO BRASIL S.A.
BCO BRASIL S.A.
BCO BRASIL S.A.
BRB BCO DE BRASILIA S.A.
CENTRAIS ELET BRAS S.A. - ELETROBRAS
CENTRAIS ELET BRAS S.A. - ELETROBRAS
CENTRAIS ELET BRAS S.A. - ELETROBRAS
Error while reading IRD: got empty string at field 'Cidade'
Error while reading shareholder department: got empty string at field 'Cidade'
CIA ENERGETICA DE BRASILIA
SHOPPING CENTER TACARUNA SA
...