Skip to content

pialexandraa/QR-code-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR code generator

Technical implementation: The web-app uses Flask, Pillow for image manipulation, and for the QR code processes (encoding, matrix generation) the libraries qrcode and segno.

URL/link address > QR code:

Random text > QR code:

Description

I kept this simple, since I wanted to write a "Pythonic" app. The implementation works well, the UI is clean, it scales, the QR codes can be updated/downloaded, and the user sees the changes in real-time. The application is designed to be web-based, and has the following characterictics:

  1. I followed strict implementation rules, with extensive (in-code) documentation notes/comments.
  2. I used Automated Matrix Scaling via the libraries - this is actually very useful because it avoids DataOverflow errors. For example, for the QR code version, I let the library do the matrix search and match (1..40). The version is not manually defined; initially, I had the version custom-defined, and later I decided to comment it out and use the automatic assignment. What I did was set the version to “None” and called qrcode.make(fit=True) => the version is picked automatically, and potential DataOverflow errors are avoided.
  3. The UI is minimalistic and uses vanilla Javascript. This offers a real-time, instant visual feedback for QR code generation, editing, and download work, as indicated by the listed options.
  4. On the SVG side, it was initially set to be displayed via an iframe, which would visually cause issues or misalignment => I switched to an image type of tag (mainly because this is a pretty static application and dynamic behavior was not expected nor needed here).

About

Web-application with Flask for encoding and converting text to QR code. For encoding, it uses qrcode (for PNG) and segno (SVG).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors