Post

Generating simple QR-codes using Python

These days, QR-codes are known by everyone, technical and non-technical people alike. These little matrix barcodes can be scanned to visit websites, acces data and so much more. In today’s guide, we will demonstrate how you can use Python to generate QR-codes for any hyperlink of your choice.

Using Python to easily generate QR-codes

Structure

QR code for this blogpost This project is based on FastAPI and the qr-code package for Python. Using a simple web interface built with Uvicorn, we can enter any hyperlink of your choice (for example, this very guide) and generate a corresponding QR-code that will allow us to navigate to the chosen website with any internet browser.

We have also exposed an endpoint for users to generate these QR-codes for use in your own application. By providing the data field with the URL of your choice (for example: https://qr.eiland-x.be/api/generate?data=https://qr.eiland-x.be/), you will receive an image your QR-code you can use.


Demo

For a demo of this functionality, visit our deployed version or scan the QR-code above! Feel free to use this to generate as many QR-codes as you want to include in your own personal projects.

This post is licensed under CC BY 4.0 by the author.