WiFiQR-Gen (Wi-Fi QRCode Generator)
Python package that generates Wi-Fi QR Codes that can be scanned for easily connecting to Wi-Fi.
Installation
pip install WiFiQRGen
Usage
Basic Usage
To generate a Wi-Fi QR Code, you need to create a WifiNetworkSettings object. For a basic home network, you'll need to provide the SSID, password, and security type. The security type is an enum from the WifiSecurity class. Optionally, if you're network is hidden, you can set the hidden parameter to True, however it is False by default and assumes the network is visible.
Options for the WifiSecurity enum are:
WifiSecurity.NONEWifiSecurity.WEPWifiSecurity.WPAWifiSecurity.WPA2WifiSecurity.WPA3
from WiFiQRGen import WifiSecurity, WifiNetworkSettings
wifi_settings = WifiNetworkSettings(
ssid="MyWifiNetworkName",
password="MyWifiPassword12345",
security=WifiSecurity.WPA2
)
my_qr_code = wifi_settings.generate_qrcode()
my_qr_code.save("wifi_qr_code.png")
Advanced Usage (Enterprise Networks)
For enterprise networks, you'll need to provide additional information. The WifiNetworkSettings object has additional parameters for this. You'll need to provide the SSID, password, security type, EAP method, and phase 2 authentication. The EAP method is an enum from the WifiEapMethod class and the phase 2 authentication is an enum from the WifiPhase2Auth class.
Options for the WifiEapMethod enum are:
WifiEapMethod.NONEWifiEapMethod.PEAPWifiEapMethod.TLSWifiEapMethod.TTLSWifiEapMethod.PWDWifiEapMethod.SIMWifiEapMethod.AKAWifiEapMethod.AKA_PRIME
Options for the WifiPhase2Auth enum are:
WifiPhase2Auth.NONEWifiPhase2Auth.PAPWifiPhase2Auth.CHAPWifiPhase2Auth.MD5WifiPhase2Auth.MSCHAPWifiPhase2Auth.MSCHAPV2WifiPhase2Auth.GTC
You can also provide a logo to be displayed in the center of the QR Code. The logo should be a square image. The generate_qrcode method takes an optional embeded_image_path parameter.
The generate_base64_qrcode_png method takes an optional embeded_image_path parameter and returns a base64 string of the QR Code image.
from WiFiQRGen import WifiSecurity, WifiEapMethod, WifiPhase2Auth, WifiNetworkSettings
wifi_settings = WifiNetworkSettings(
ssid="MyWifiNetwork",
password="MyWifiPassword12345",
security=WifiSecurity.WPA2,
eap_method=WifiEapMethod.PEAP,
phase2_auth=WifiPhase2Auth.MSCHAPV2,
hidden=True,
identity="MyUsername"
)
# Generate QR Code with logo in center
my_qr_code = wifi_settings.generate_qrcode('path/to/logo.png')
# Save QR Code to file
my_qr_code.save("wifi_qr_code.png")
# Generate QR Code with a logo in the center and get it as a base64 string
base64_qr_code = my_qr_code.generate_base64_qrcode_png('path/to/logo.png')
Metadata
Release files for WiFiQRGen 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wifiqrgen-0.1.0.tar.gz | 13.5 kB | Without provenance | Details for wifiqrgen-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wifiqrgen-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for wifiqrgen-0.1.0-py3-none-any.whl |
Total release size: 18.0 kB
Release files / wifiqrgen-0.1.0.tar.gz
| Download URL | wifiqrgen-0.1.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6253db3c8e818034de488e09c423f7736c92dabf72e1578a1524fa0a76c1830e
|
|
BLAKE2b-256 checksum How to use checksums |
4c89524c389ab107903755858e45c05c1b74b455d8c949435ddeb1f117a42d57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / wifiqrgen-0.1.0-py3-none-any.whl
| Download URL | wifiqrgen-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
885d7ffaef6c8c29d3929e7d1fc833041b2fcefe853a114c87093c85f5549f43
|
|
BLAKE2b-256 checksum How to use checksums |
6ddf24c0a4a39721d0fb12c6a6eaf21aa4f0139dfac3f05ccac32916215517f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for WiFiQRGen 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.