Skip to main content

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


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 details)

Uploaded Source

Built Distribution

pypix_static-0.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pypix-static-0.0.1.tar.gz.

File metadata

  • Download URL: pypix-static-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for pypix-static-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ad405b9fdb079e31063c7f3ab7f4009ab3ac60bc06858919f2ba3005f50f90c1
MD5 c4fbb56e9a400bb12727884b6f914182
BLAKE2b-256 495daa3b9475c9d630a7db03c71267fb33b0ecb036aa8d734baf8f665740d29a

See more details on using hashes here.

File details

Details for the file pypix_static-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pypix_static-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for pypix_static-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e8741f0761de3ec02b35cc5e88ec8ea1c4eb2d88ee09c9f493c39b2f507d0dc
MD5 5b305bed28e1d0522da33c8e22fc5286
BLAKE2b-256 7b6d858b8afb140b7391a11cbedbd05b5d335c29ebbb91a4735f9fb8799f0864

See more details on using hashes here.

Supported by

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