https://github.com/rfschubert/pys-integrabanco
Leitura de arquivos bancarios, francesinhas, .TXT ou .RET
https://github.com/rfschubert/pys-integrabanco
bb boleto cnab400 python santander
Last synced: 5 months ago
JSON representation
Leitura de arquivos bancarios, francesinhas, .TXT ou .RET
- Host: GitHub
- URL: https://github.com/rfschubert/pys-integrabanco
- Owner: rfschubert
- License: gpl-3.0
- Created: 2019-06-20T20:11:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-23T14:27:19.000Z (over 6 years ago)
- Last Synced: 2025-06-01T05:11:30.774Z (9 months ago)
- Topics: bb, boleto, cnab400, python, santander
- Language: Python
- Size: 31.3 KB
- Stars: 7
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pys-integrabanco
SDK para integração de arquivos bancários, normalmente nos padrões `CNAB`
### Como instalar
```shell
$ pip install pysintegrabanco
```
### Como usar BB
```python
from pysintegrabanco.banco_do_brasil import BancoDoBrasil
import os
dirpath = os.getcwd()
endereco = dirpath + '/src/bb_cnab400.ret'
bb = BancoDoBrasil()
# calcula o total de linhas no arquivo
with open(endereco, 'r') as arquivo:
bb.conta_total_linhas_arquivo(arquivo)
# efetua o processamento
with open(endereco, 'r') as arquivo:
bb.processa_arquivo(arquivo)
print(bb.TOTAL_LINHAS_ARQUIVO)
# int
print(bb.HEADER)
# dict
print(bb.DETALHES)
# list
print(bb.TRAILLER)
# dict
```
### Como usar Santander
```python
from pysintegrabanco.santander import ProcessaFrancesinha
import os
dirpath = os.getcwd()
arquivo = dirpath + '/src/santander_francesinha_com_liquidacao.txt'
integra = ProcessaFrancesinha()
integra.processa_arquivo(arquivo)
print(integra.BOLETOS)
# [BoletoSantander(...)]
print(integra.TOTAL_BOLETOS)
# 1
```