├── .deepsource.toml
├── Driver.py
├── QR_Generator.py
├── README.md
└── Tutorial.mp4
/.deepsource.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 |
3 | [[analyzers]]
4 | name = "python"
5 |
6 | [analyzers.meta]
7 | runtime_version = "3.x.x"
--------------------------------------------------------------------------------
/Driver.py:
--------------------------------------------------------------------------------
1 | from distutils.command.upload import upload
2 | import gradio as gr
3 | from QR_Generator import generate_qr
4 | import qrcode
5 |
6 | def tutorial():
7 | url="https://github.com/devfinwiz/Dynamic-QRCode-Generator/raw/master/Tutorial.mp4"
8 | QRcode = qrcode.QRCode(version=1,box_size=12,
9 | error_correction=qrcode.constants.ERROR_CORRECT_H
10 | )
11 | # adding URL or text to QRcode
12 | QRcode.add_data(url)
13 | # generating QR code
14 | QRcode.make()
15 | # adding color to QR code
16 | QRimg = QRcode.make_image(fill_color="white",back_color="black").convert('RGB')
17 |
18 | #QRimg.save('Tutorial.png')
19 | return QRimg
20 |
21 |
22 | with gr.Blocks(title="Dynamic-QR",css="#heading{background-color:#32a8a8}") as demo:
23 |
24 | gr.Label(elem_id="heading",value="DYNAMIC-QR",label="Title")
25 |
26 | with gr.Tab("Input"):
27 | text_input = gr.Textbox(label="URL",placeholder="URL To Be Mapped To QR code")
28 | color_input = gr.ColorPicker(label="Pick A Color")
29 | status=gr.Textbox(label="Status")
30 | text_button = gr.Button("Generate QR Code",elem_id="generate_qr")
31 |
32 | with gr.Tab("Output"), gr.Row():
33 | image_output = gr.Image(label="QR Code").style(height=350,width=500)
34 |
35 | with gr.Tab("View Demo"):
36 | with gr.Row():
37 | tut_button=gr.Button("View Demo Usage")
38 | demo_video = gr.Image(label="Demo").style(height=350,width=500)
39 |
40 | gr.Label("Scan The Code For Demo Tutorial")
41 |
42 | tut_button.click(tutorial,inputs=[],outputs=[demo_video])
43 | text_button.click(generate_qr, inputs=[text_input,color_input], outputs=[status,image_output])
44 |
45 | demo.launch()
46 |
47 |
--------------------------------------------------------------------------------
/QR_Generator.py:
--------------------------------------------------------------------------------
1 | from distutils.version import Version
2 | from turtle import width
3 | import qrcode
4 | from PIL import Image
5 | import requests
6 |
7 | flag=0
8 |
9 | def url_checker(url):
10 | try:
11 | #Get Url
12 | get = requests.get(url)
13 | # if the request succeeds
14 | return get.status_code == 200
15 |
16 | #Exception
17 | except requests.exceptions.RequestException as e:
18 | # print URL with Errs
19 | raise SystemExit(f"{url}: is Not reachable \nErr: {e}")
20 |
21 | def generate_qr(url,qr_color):
22 | if(url==""):
23 | return "Failed"
24 |
25 | if(url_checker(url)):
26 |
27 | #Logo_link = logoo
28 |
29 | #logo = Image.open(Logo_link)
30 |
31 | # taking base width
32 | #basewidth = 190
33 |
34 | # adjust image size
35 | #wpercent = (basewidth/float(logo.size[0]))
36 | #hsize = int((float(logo.size[1])*float(wpercent)))
37 | #logo = logo.resize((basewidth, hsize), Image.ANTIALIAS)
38 |
39 | QRcode = qrcode.QRCode(version=1,box_size=12,
40 | error_correction=qrcode.constants.ERROR_CORRECT_H
41 | )
42 |
43 | # adding URL or text to QRcode
44 | QRcode.add_data(url)
45 | # generating QR code
46 | QRcode.make()
47 |
48 | # taking color name from user
49 | QRcolor = qr_color
50 |
51 | # adding color to QR code
52 | QRimg = QRcode.make_image(
53 | fill_color=QRcolor, back_color="black").convert('RGB')
54 |
55 | #pos = ((QRimg.size[0] - logo.size[0]) // 2,
56 | # (QRimg.size[1] - logo.size[1]) // 2)
57 | #QRimg.paste(logo, pos)
58 |
59 | # save the QR code generated
60 | QRimg.save('Generated_QRCode.png')
61 |
62 | return "Success",QRimg
63 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Cost Effective Way To Ditch Paid QR Codes
6 |
7 |
8 |
9 |
10 | [](https://twitter.com/intent/tweet?text=Generate%20your%20customizable%20QR%20Code%20now%20in%20less%20than%20a%20minute!%0A%0Ahttps%3A%2F%2Fhuggingface.co%2Fspaces%2Fdevfinwiz%2FDynamic-QR)
11 |
12 |
13 |
14 | | **Discussion** | **Bugs/Issues** | **Demo Tutorial** | **Contribute** |
15 | | :---: | :---: | :---: | :---: |
16 | | [](https://github.com/devfinwiz/Dynamic-QR/discussions) | [](https://github.com/devfinwiz/Dynamic-QR/issues/new/choose) | [](https://github.com/devfinwiz/Dynamic-QR/raw/master/Tutorial.mp4) | [](https://github.com/devfinwiz/Dynamic-QR/fork)
17 | | Join/Read the Community Discussion | Raise an Issue about a Problem | Get Help about Usage | Contribute With New Features |
18 |
19 | 
20 |
21 | ## What is Dynamic-QR?
22 |
23 | Dynamic-QR is a modern, fast(high-performance) web app for generating customised realtime dynamic QR codes with Python. Although Dynamic-QR is currently in its early stages of development, it is capable to serve small businesses that is looking to automate multiple basic operations.
24 |
25 | Key Features:
26 |
27 | * **Dynamic**: Lets user feed URL of their choice at runtime to generate QR Codes mapped to specific URL.
28 | * **Fast**: Produces deployment ready QR Codes within seconds.
29 | * **Customizable**: Lets user customize their QR Codes with tons of variety of fill colors to choose from.
30 | * **Intuitive**: User-friendly user interface to avoid users to get lost, confused.
31 | * **Validation**: Validates user inputted URL to ensure correctness of the generated QR Code.
32 |
33 | Few Upcoming Features:
34 |
35 | * **Logo Embedded QR Codes**: It will let user have their organization's logo placed over the QR Codes to increase engagement.
36 | * **File Mapping**: This feature will allow users to map files of any format (pdf,csv,word,powerpoint,etc) to QR Codes to enable downloading/viewing file by scanning QR Code.
37 |
38 | How to perform file mapping right now?
39 |
40 | * **Upload your file on Google Drive**: From Drive, click share, change settings for access of file to 'anyone with the link'. Post the drive link in the DynamicQR web app and get your QR Code ready within seconds!
41 |
42 | * **Example**: Getting QR Code ready for your restaurant menu card.
43 |
44 | 
45 |
46 | ## Glimpses of Dynamic-QR:
47 |
48 | 
49 | 
50 |
51 | 
52 |
53 | External Libraries Used:
54 |
55 | * **gradio**
56 | * **qrcode**
57 | * **pillow**
58 |
59 | Installation can be carried out using pip. (Example: pip install qrcode)
60 |
61 |
62 |
63 | [](https://twitter.com/intent/tweet?text=Generate%20your%20customizable%20QR%20Code%20now%20in%20less%20than%20a%20minute!%0A%0Ahttps%3A%2F%2Fhuggingface.co%2Fspaces%2Fdevfinwiz%2FDynamic-QR)
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Tutorial.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devfinwiz/Dynamic-QR/8be37e5269040e4d1332cce485c1099ff2427a5a/Tutorial.mp4
--------------------------------------------------------------------------------