Skip to main content

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

  1. install the lib:

    pip install wifiqr-core
    
  2. Varouise ways to use:

    • Import as a lib or an API:

      from wifiqr_core import wifi_2_qr
      
      # 🛠 Initialize the class
      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

# change this to the desired output image name.
img_name = "QR_CODE"

ssid = "your_wifi_name"
password = "your_wifi_pass"

# 🛠 Initialize the class
wq = wifi_2_qr()

# 🔐 Get WiFi credentials
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..!")


# 🎨 Build the QR-Code
qr_img = wq.get_qr(my_wifi_info)
print(qr_img)


# 💾 Save the qrcode as .png img in local dir
wq.save_qr(qr_img, img_name)

# or you can:
# qr_img.save(img_name + " .png")


👨‍💻 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

  1. Get connected WLAN/WiFi creditionals (SSID+Password)

  2. Generte a QR-code from WiFi creds.

Extras

  • 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

extras tools

  • Web-UI:
    • Flask & Jinja.
    • HTML5, CSS3 & JS.
    • TailwindCSS.
  • Desktop-UI:
    • pyQT

Metadata

Release files for wifiqr-core 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wifiqr-core 1.1.0
File Size Uploaded Provenance Actions
wifiqr-core-1.1.0.tar.gz 4.9 kB Without provenance Details for wifiqr-core-1.1.0.tar.gz

Release files / wifiqr-core-1.1.0.tar.gz

Download URL wifiqr-core-1.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
64dc15c6802d1729d7c4018cd83cbe4170692029173beca683f8cfeb6f3da3d7
BLAKE2b-256 checksum
How to use checksums
b17c111e78f09ab172ecab5a8800e0d328769c3705ff3ceafda7fe25112bddaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Security for wifiqr-core 1.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page