Skip to main content

A Python library for generating and displaying QR codes.

Project description

Project Title

QR generator tool that returns either a PNG, postscript file, or a postscript object of an input string

Description

I created this QR generator tool with the express purpose of generating custom QR codes for PDFs without the need for an adobe subscription. The returned postscript data can be used to place into a prewritten postscript file and then converted into a PDF using ghostscript.

Getting Started

Dependencies

  • In order to generate a QR image you will require both cv2 and numpy
    pip install opencv-contrib-python
    pip install numpy
    

Installing

  • Clone the repo
    git clone https://github.com/PimpDiCaprio/PiQR.git
    
  • Installing with pip
    pip install PiQR
    

Executing program

  • How to run the program
  • Step-by-step bullets
from PiQR import PiQR

# define the input string for the qr code
qr_string = 'Test Input'

# generate qr binary for the input string
qr_output = PiQR.generate_qr(qr_string, correction_level='Medium')

# the following options are available for displaying or saving the qr code

# display the qr code
PiQR.show_png(qr_output)

# save the qr as a png
PiQR.make_png(qr_output, 'test.png')

# write a postscript file containing the qr
PiQR.write_ps(qr_output, 'test.ps')

# return a postscript object in string form for placement into a ps file
ps_string = PiQR.return_ps(qr_output)

Author

PimpDiCaprio info@aperturesoftware.us

Version History

  • 0.1.1
    • Import Name Fixes
  • 0.1.0
    • Initial Release
  • 0.1.2
    • Update to module size designation in qr_ps
  • 0.1.3
    • Fixed broken byte conversion for Alphanumeric QR generation
  • 0.1.4
    • Update to data_analysis, added json storage for the dictionaries to clean up the code
  • 0.1.5
    • Fixed broken project upload
  • 0.1.6
    • Fixed missing json file

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Inspiration, code snippets, etc.

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

piqr-0.1.6.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

piqr-0.1.6-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file piqr-0.1.6.tar.gz.

File metadata

  • Download URL: piqr-0.1.6.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for piqr-0.1.6.tar.gz
Algorithm Hash digest
SHA256 1636811be97270a8039743d5fbb05746359cab477e25171b7bc2eecad2aa37e5
MD5 ea481e18f2ff671b57c8f60527f541a3
BLAKE2b-256 a57969f13777545ba81aef1215bd0f1820f093b4460a7e345b5d3458522031ff

See more details on using hashes here.

File details

Details for the file piqr-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: piqr-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for piqr-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cfc813cc58d8cbd188f29b1a15d3b7383d9ec5935a4b2ca5b7eeea2504084ce8
MD5 e1968bda1a4ac73acc863ee2991d1db6
BLAKE2b-256 1b003b01d313d5441f519d0d8894229b4f9a51dcf1145b717ce30513daf45779

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