Skip to main content

Parser Cielo EDI: converte CIELO03/04/09/15/16 para JSON/CSV

Project description

Cielo EDI Parser

PyPI version Python 3.9+ License: MIT

Parser para arquivos Cielo EDI (Extrato Eletrônico). Converte CIELO03/04/09/15/16 para JSON ou CSV.

Features

  • Suporta CIELO03/04/09/15/16
  • Validação com Pydantic v2
  • Streaming para arquivos grandes
  • Exportação JSON e CSV
  • CLI incluída

Instalação

pip install cielo-edi

Requisitos: Python 3.9+, Pydantic 2.5+ e pytest (para testes)

Uso

from cielo_edi import CieloEDIParser, JSONExporter, CSVExporter

parser = CieloEDIParser()
resultado = parser.processar("CIELO04_20241218.txt")

# Acessar dados
print(f"Tipo: {resultado.tipo_arquivo_descricao}")
print(f"Valor: R$ {resultado.estatisticas.valor_liquido_total:,.2f}")

for detalhe in resultado.detalhes:
    print(f"{detalhe.nsu_doc} | R$ {detalhe.valor_liquido_venda:,.2f}")

# Exportar JSON
exporter = JSONExporter(indent=2)
exporter.exportar_arquivo(resultado, "saida.json")

# Exportar CSV
CSVExporter(delimiter=";").exportar_todos(resultado, "./csv/")

# Streaming (arquivos grandes)
for registro in parser.processar_streaming("arquivo_10GB.txt"):
    processar(registro)

CLI

cielo-edi arquivo.txt -o resultado.json
cielo-edi arquivo.txt --formato csv --diretorio ./saida
cielo-edi arquivo.txt --info

Tipos de Arquivo

Código Descrição
CIELO03 Captura/Previsão
CIELO04 Liquidação/Pagamento
CIELO09 Saldo em Aberto
CIELO15 Negociação de Recebíveis
CIELO16 Pix

Tipos de Registro

Código Descrição
0 Header
D UR Agenda (Unidade de Recebimento)
E Detalhe do Lançamento
8 Transação Pix
A Resumo de Negociação
B Detalhe de Negociação
C Conta de Recebimento
R Reserva Financeira
9 Trailer

Links

Licença

MIT - Esta biblioteca não é oficial e não possui vínculo com a Cielo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cielo_edi-15.14.1.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cielo_edi-15.14.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file cielo_edi-15.14.1.tar.gz.

File metadata

  • Download URL: cielo_edi-15.14.1.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cielo_edi-15.14.1.tar.gz
Algorithm Hash digest
SHA256 9bb2acc047fc49822efe30ce0e0d9ac7d44f4155ffd49e1c21e9f51f982aa25f
MD5 2aa40e499b39c3e629500649ab0db6b9
BLAKE2b-256 eeeca5141bb29dbe0f29ab2d43c452f778dd6f5f85c3ac9cd097158d6dbb58fb

See more details on using hashes here.

File details

Details for the file cielo_edi-15.14.1-py3-none-any.whl.

File metadata

  • Download URL: cielo_edi-15.14.1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cielo_edi-15.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6e981d7658ad1c71f39557e704a8a404eb7dc7164eb6f60e85e5f62aca1c762
MD5 4957560ab16878c5175b98f966abb9a1
BLAKE2b-256 1a00b3b36b321f49b98c6ceed9ec4e124057db24a2d90a71c8b9119c9ef2cc25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page