Python library for generating Brazil's static PIX codes.
Project description
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pypix-static-0.0.1.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for pypix_static-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e8741f0761de3ec02b35cc5e88ec8ea1c4eb2d88ee09c9f493c39b2f507d0dc |
|
MD5 | 5b305bed28e1d0522da33c8e22fc5286 |
|
BLAKE2b-256 | 7b6d858b8afb140b7391a11cbedbd05b5d335c29ebbb91a4735f9fb8799f0864 |