Skip to main content

Parsing Documents

You can parse documents like NFSe and Boletos using the abstra.ai module.

from abstra.ai import parse_boleto, parse_nfse
from abstra.forms import FileInput, run

# Parsing a NFSe
upload_page = [
FileInput(label="Nfse Input", key="my_nfse_input"),
]

nfse_file = run([upload_page])["my_nfse_input"]

parsed_nfse = parse_nfse(nfse_file.path)
print(parsed_nfse.razao_social_prestador, parsed_nfse.cnpj_prestador)

# Parsing a Boleto
upload_page = [
FileInput(label="Boleto Input", key="my_boleto_input"),
]

boleto_file = run([upload_page])["my_boleto_input"]

parsed_boleto = parse_boleto(boleto_file.path)
print(parsed_boleto.codigo_de_barras, parsed_boleto.valor)