WiFiQR-Core
Generate a QR code to share WiFi creds (SSID+Pass).
this is the core functionality, a library/API used by the WiFiQR WebApp.
Usage
-
install the lib:
pip install wifiqr-core
-
Varouise ways to use:
-
Import as a lib or an API:
from wifiqr_core import wifi_2_qr
wq = wifi_2_qr()
-
CLI tool:
$ wifiqr-core
⚠️ As a MacOS user, you gotta fill in manually...
✍️ WiFi Name: ******
🙈 Hidden Network (yes/no): no
🔐 WiFi Password (leave empty if none): **********
🎨 Output/image name: qr
Example
Install and use on your own projects.
Following exmaple shows how to creat an img.png
containing a QR-Code with your WiFi creditionals.
from wifiqr_core import wifi_2_qr
img_name = "QR_CODE"
ssid = "your_wifi_name"
password = "your_wifi_pass"
wq = wifi_2_qr()
try:
my_wifi_info = wq.get_wifi()
print(my_wifi_info)
except TypeError:
"Incase using MacOS, must set the wifi manually"
my_wifi_info = wq.set_wifi(
ssid=ssid, password=password, auth_type='WPA2', hidden="false")
except:
print("Something wrong accored..!")
qr_img = wq.get_qr(my_wifi_info)
print(qr_img)
wq.save_qr(qr_img, img_name)
👨💻 Dev
If you would like to develop the project...
☁️ Instalation
you need
- python 3 & pip.
- pipenv.
- qrcode.
- Pillow.
Start developing
-
clone the repo (or better fork it):
git clone https://github.com/MoElaSec/WiFiQR_Core
cd WiFiQR_Core
-
install requirments:
pipenv install
If you don't have pipenv (high recommend you do), A requirments.txt file is provided use:
`pip install -r requirments.txt` instead.
🧐 How it works
- Create a Web-UI:
- Show generated QR-code.
- Copy+Print button for QR-code.
- Create a Desktop-UI.
🛠 Tools
- Python 3
- QRcode:
pip install qrcode
- Web-UI:
- Flask & Jinja.
- HTML5, CSS3 & JS.
- TailwindCSS.
- Desktop-UI: