Git Product home page Git Product logo

pypix's Introduction

This is a python package for generatic static PIX code used in money transfers in Brazil. It follows the version 2.3.0 of the Manual de Padrões para Iniciação do PIX.

This can be used for automation of QR Code generation to improve your software user experience.

Installation

Just run:

pip install pypix-static

Usage

>>> from pypix import create_pix_string_code
>>> from decimal import Decimal
>>> receiver_params = {
... 'key': '12345678900', # This is an example CPF of an hypothetical receiver
... 'name': 'Hypothetical Receiv Name', # Must be less than 25 characters long.
... 'city': 'CITY RECEIVER', # all uppercase ASCII format. 15 characters max
... 'value': Decimal('12.34'), # Do not set this, if you don't want specify a value and leave up to payer to fill this in their PSP application (e.g. mobile or web banking app)
... }
>>> code = create_pix_string_code(**receiver_params)
>>> print(code)
00020126330014BR.GOV.BCB.PIX011112345678900520400005303986540512.345802BR5924Hypothetical Receiv Name6013CITY RECEIVER62070503***6304EA64

# If you want to generate a QR code
>>> from qrcode import make  # You need to install it before running this
>>> image = make(code)
>>> image.save('qrcode_pix.png')

Demo

pypix's People

Contributors

feslima avatar

Stargazers

Roman avatar Gustavo Santana avatar

Watchers

 avatar

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.