Giter Site home page Giter Site logo

boleto2py's Introduction

boleto2py

Módulo para geração de boletos no web2py, baseado no código do pyboleto

Licença

O módulo esta licenciado sob a licença BSD

Estrutura do módulo

boleto2py/

boleto2py/gerador.py

boleto2py/banrisul.py

gerador.py possui algumas funcionalidades comuns aos boletos, banrisul.py possui funcionalidades específicas a este banco. Embora exista um padrão mínimo, cada banco tem suas particularidades.

Criando novos boletos

Para criar um novo boleto, basta importar o arquivo gerador.py e criar os digitos verificadores, linha digitável, fator de vencimento e código de barra

Exemplo de uso

def imprime_boleto_banrisul():
    import boleto2py.banrisul as banrisul
    import boleto2py.gerador as gerador

    vcto = '2012-07-10'
    valor = '34.98'
    doc_num = '1'
    
    barras = banrisul.gera_cod_barras(valor.replace('.',''), doc_num, vcto)

    gera_linha = banrisul.gera_linha_digitavel(barras[0])
    cod_barra_boleto = gerador.getcodbarra(barras[0])
    tipo = 'gif'
    cod_barra_boleto.save('applications/boleto2py/static/barcode/%s.%s'%(barras[0],tipo), tipo)
    img_barras = '%s.%s'%(barras[0],tipo)

Bancos Homologados até o momento

  • Banrisul

Referências externas

Além do pyboletos, utilizei as seguintes referências

http://informacaocomdiversao.blogspot.com/2009/01/entendendo-como-formada-linha-digitvel.html

https://github.com/klawdyo/PHP-Object-Boleto

http://thiagosm.wordpress.com/2008/06/07/codigo-de-barra-em-python/

pyboletos

boleto2py's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

web2pycwb rosanaw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.