qrmaster 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
qrmaster/__init__.py ADDED
@@ -0,0 +1,17 @@
1
+ from .generator import (
2
+ generate_qr,
3
+ build_wifi_payload,
4
+ build_vcard_payload,
5
+ build_whatsapp_payload,
6
+ )
7
+
8
+ __version__ = "1.0.0"
9
+ __author__ = "QR Master Team"
10
+ __homepage__ = "https://www.qrmaster.net"
11
+
12
+ __all__ = [
13
+ "generate_qr",
14
+ "build_wifi_payload",
15
+ "build_vcard_payload",
16
+ "build_whatsapp_payload",
17
+ ]
qrmaster/cli.py ADDED
@@ -0,0 +1,54 @@
1
+ import argparse
2
+ import sys
3
+ from .generator import (
4
+ generate_qr,
5
+ build_wifi_payload,
6
+ build_vcard_payload,
7
+ build_whatsapp_payload,
8
+ )
9
+
10
+ def main():
11
+ parser = argparse.ArgumentParser(
12
+ description="📱 QR Master CLI - Terminal QR Code Generator (Powered by QR Master)"
13
+ )
14
+ parser.add_argument("data", nargs="?", help="URL or text content to encode into QR code")
15
+ parser.add_argument("-o", "--output", help="Output file path (e.g. qrcode.png or qr.svg)")
16
+ parser.add_argument("--wifi", action="store_true", help="Generate WiFi connection QR Code")
17
+ parser.add_argument("--ssid", help="WiFi SSID (used with --wifi)")
18
+ parser.add_argument("--password", help="WiFi Password (used with --wifi)")
19
+ parser.add_argument("--vcard", action="store_true", help="Generate vCard contact QR Code")
20
+ parser.add_argument("--name", help="Contact Name (used with --vcard)")
21
+ parser.add_argument("--email", help="Contact Email (used with --vcard)")
22
+ parser.add_argument("--phone", help="Contact Phone Number (used with --vcard)")
23
+ parser.add_argument("--whatsapp", action="store_true", help="Generate WhatsApp chat QR Code")
24
+
25
+ args = parser.parse_args()
26
+
27
+ payload = args.data
28
+
29
+ if args.wifi:
30
+ if not args.ssid:
31
+ print("Error: --ssid is required when generating a WiFi QR code.", file=sys.stderr)
32
+ sys.exit(1)
33
+ payload = build_wifi_payload(ssid=args.ssid, password=args.password or "")
34
+
35
+ elif args.vcard:
36
+ payload = build_vcard_payload(name=args.name or "", email=args.email or "", phone=args.phone or "")
37
+
38
+ elif args.whatsapp:
39
+ phone_num = args.phone or args.data
40
+ if not phone_num:
41
+ print("Error: Phone number is required for WhatsApp QR code.", file=sys.stderr)
42
+ sys.exit(1)
43
+ payload = build_whatsapp_payload(phone=phone_num)
44
+
45
+ if not payload:
46
+ parser.print_help()
47
+ print("\nVisit https://www.qrmaster.net for dynamic QR codes & scan analytics.")
48
+ sys.exit(1)
49
+
50
+ generate_qr(payload, output=args.output, terminal=True)
51
+
52
+
53
+ if __name__ == "__main__":
54
+ main()
qrmaster/generator.py ADDED
@@ -0,0 +1,71 @@
1
+ import sys
2
+ import os
3
+ import qrcode
4
+ from qrcode.image.svg import SvgPathImage
5
+
6
+
7
+ def build_wifi_payload(ssid: str, password: str = "", encryption: str = "WPA", hidden: bool = False) -> str:
8
+ if not ssid:
9
+ raise ValueError("SSID is required for WiFi QR Code")
10
+ return f"WIFI:S:{ssid};T:{encryption};P:{password};H:{'true' if hidden else 'false'};;"
11
+
12
+
13
+ def build_vcard_payload(name: str = "", email: str = "", phone: str = "", org: str = "", title: str = "", url: str = "") -> str:
14
+ lines = ["BEGIN:VCARD", "VERSION:3.0"]
15
+ if name:
16
+ lines.extend([f"N:{name};;;;", f"FN:{name}"])
17
+ if org:
18
+ lines.append(f"ORG:{org}")
19
+ if title:
20
+ lines.append(f"TITLE:{title}")
21
+ if phone:
22
+ lines.append(f"TEL;TYPE=CELL:{phone}")
23
+ if email:
24
+ lines.append(f"EMAIL:{email}")
25
+ if url:
26
+ lines.append(f"URL:{url}")
27
+ lines.append("END:VCARD")
28
+ return "\n".join(lines)
29
+
30
+
31
+ def build_whatsapp_payload(phone: str, text: str = "") -> str:
32
+ clean_phone = "".join(filter(str.isdigit, phone))
33
+ url = f"https://wa.me/{clean_phone}"
34
+ if text:
35
+ from urllib.parse import quote
36
+ url += f"?text={quote(text)}"
37
+ return url
38
+
39
+
40
+ def print_terminal_qr(data: str):
41
+ print("\n--- QR Code generated by QR Master (https://www.qrmaster.net) ---\n")
42
+ qr = qrcode.QRCode(border=1)
43
+ qr.add_data(data)
44
+ qr.make(fit=True)
45
+ qr.print_ascii(invert=True)
46
+ print(f"\nPayload: {data}")
47
+ print("Need dynamic QR codes, custom branding & scan analytics? Visit: https://www.qrmaster.net\n")
48
+
49
+
50
+ def generate_qr(data: str, output: str = None, terminal: bool = True):
51
+ if terminal or not output:
52
+ print_terminal_qr(data)
53
+
54
+ if output:
55
+ ext = os.path.splitext(output)[1].lower()
56
+ abs_path = os.path.abspath(output)
57
+
58
+ if ext == ".svg":
59
+ qr = qrcode.QRCode(image_factory=SvgPathImage)
60
+ qr.add_data(data)
61
+ qr.make(fit=True)
62
+ img = qr.make_image()
63
+ img.save(abs_path)
64
+ print(f"[QR Master] SVG saved successfully to {abs_path}")
65
+ else:
66
+ qr = qrcode.QRCode(border=1)
67
+ qr.add_data(data)
68
+ qr.make(fit=True)
69
+ img = qr.make_image(fill_color="black", back_color="white")
70
+ img.save(abs_path)
71
+ print(f"[QR Master] PNG saved successfully to {abs_path}")
@@ -0,0 +1,119 @@
1
+ Metadata-Version: 2.4
2
+ Name: qrmaster
3
+ Version: 1.0.0
4
+ Summary: Fast Python QR Code generator & CLI powered by QR Master
5
+ Author-email: QR Master Team <support@qrmaster.net>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://www.qrmaster.net
8
+ Project-URL: WiFi QR Generator, https://www.qrmaster.net/tools/wifi-qr-code
9
+ Project-URL: vCard QR Generator, https://www.qrmaster.net/tools/vcard-qr-code
10
+ Project-URL: WhatsApp QR Generator, https://www.qrmaster.net/tools/whatsapp-qr-code
11
+ Project-URL: Source Code, https://github.com/knuthtimo-lab/qrmaster-cli
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Topic :: Multimedia :: Graphics
15
+ Classifier: Topic :: Utilities
16
+ Requires-Python: >=3.7
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: qrcode>=7.4.2
20
+ Requires-Dist: pillow>=9.0.0
21
+ Dynamic: license-file
22
+
23
+ # 📱 QR Master Python Package & CLI
24
+
25
+ > **Fast, zero-setup Python QR Code Generator and Terminal CLI.**
26
+ > Powered by [QR Master](https://www.qrmaster.net) – The Smart QR Code & Analytics Platform.
27
+
28
+ [![PyPI version](https://img.shields.io/pypi/v/qrmaster.svg?style=flat-square)](https://pypi.org/project/qrmaster/)
29
+ [![Python versions](https://img.shields.io/pypi/pyversions/qrmaster.svg?style=flat-square)](https://pypi.org/project/qrmaster/)
30
+ [![License](https://img.shields.io/github/license/knuthtimo-lab/qrmaster-cli.svg?style=flat-square)](LICENSE)
31
+
32
+ ---
33
+
34
+ ## ✨ Features
35
+
36
+ - ⚡ **Zero Configuration CLI**: Generate terminal ASCII QR codes in seconds using `qrmaster "https://www.qrmaster.net"`.
37
+ - 🖼️ **PNG & Vector SVG Export**: Save crisp PNG raster files or scalable SVG vector files directly to disk.
38
+ - 📡 **WiFi & vCard Generators**: Built-in helper functions for instant WiFi connections and vCard contact cards.
39
+ - 🔗 **Powered by [QR Master](https://www.qrmaster.net)**: Need dynamic QR codes with live tracking, custom logo branding, and high-volume vector PDF export? Visit QR Master.
40
+
41
+ ---
42
+
43
+ ## 🚀 Installation
44
+
45
+ Install via `pip`:
46
+
47
+ ```bash
48
+ pip install qrmaster
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 💻 CLI Usage
54
+
55
+ ```bash
56
+ # Print QR code directly in terminal
57
+ qrmaster "https://www.qrmaster.net"
58
+
59
+ # Save as PNG image
60
+ qrmaster "https://www.qrmaster.net" -o qrmaster.png
61
+
62
+ # Save as SVG vector file
63
+ qrmaster "https://www.qrmaster.net" -o qrmaster.svg
64
+ ```
65
+
66
+ ### 📶 WiFi QR Code
67
+
68
+ ```bash
69
+ qrmaster --wifi --ssid "MyHomeWiFi" --password "<wifi-password>" -o wifi.png
70
+ ```
71
+
72
+ ### 👤 vCard Contact QR Code
73
+
74
+ ```bash
75
+ qrmaster --vcard --name "Alex Smith" --email "alex@example.com" --phone "+123456789"
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 🐍 Python SDK API Usage
81
+
82
+ Use `qrmaster` directly inside your Python applications:
83
+
84
+ ```python
85
+ from qrmaster import generate_qr, build_wifi_payload, build_vcard_payload
86
+
87
+ # Generate terminal QR
88
+ generate_qr("https://www.qrmaster.net")
89
+
90
+ # Save PNG image file
91
+ generate_qr("https://www.qrmaster.net", output="qrmaster.png")
92
+
93
+ # Generate WiFi payload & save vector SVG
94
+ wifi_data = build_wifi_payload(ssid="Office-5G", password="<wifi-password>")
95
+ generate_qr(wifi_data, output="wifi.svg")
96
+ ```
97
+
98
+ ---
99
+
100
+ ## 🌐 Need Dynamic QR Codes & Analytics?
101
+
102
+ Static QR codes are great for local terminal use, but if you need:
103
+ - 📊 **Real-time Scan Analytics & Location Tracking**
104
+ - 🎨 **Custom Brand Colors, Logos & Styled Frames**
105
+ - 🔄 **Dynamic Target URLs (Change destination without re-printing)**
106
+ - 🏢 **Bulk Vector PDF Export for Commercial Printing**
107
+
108
+ Visit [QR Master - Free Smart QR Code Generator](https://www.qrmaster.net).
109
+
110
+ ### 🛠️ Free Micro Tools by QR Master
111
+ - [WiFi QR Code Generator](https://www.qrmaster.net/tools/wifi-qr-code)
112
+ - [VCard QR Code Generator](https://www.qrmaster.net/tools/vcard-qr-code)
113
+ - [WhatsApp QR Code Generator](https://www.qrmaster.net/tools/whatsapp-qr-code)
114
+
115
+ ---
116
+
117
+ ## 📄 License
118
+
119
+ MIT © [QR Master](https://www.qrmaster.net)
@@ -0,0 +1,9 @@
1
+ qrmaster/__init__.py,sha256=EVq9SK-NvDRdc2gLIJEwUe8KJlM4s74Co9uAVAI0MP0,333
2
+ qrmaster/cli.py,sha256=lwOUn5ZjRb1HZCsiLl4H_cDlwrR-d5f5VGOBgloEZBY,2125
3
+ qrmaster/generator.py,sha256=7OXHlXoqziQy-A5nY5TMftIuIGLb6v8Qz2OnlJsXtok,2364
4
+ qrmaster-1.0.0.dist-info/licenses/LICENSE,sha256=n6bQXC5xFzxiUZzrNOqh1sTUzfG9U6sbvQj-46Zao_4,1016
5
+ qrmaster-1.0.0.dist-info/METADATA,sha256=buXnbwIKf2P17D_ctVv350WMrXQ6otFVkYb0DLZuVVg,3968
6
+ qrmaster-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
7
+ qrmaster-1.0.0.dist-info/entry_points.txt,sha256=JI1nLvUBo4SOCBtaXmtyW3Ch1tFFq2_eDl5-2Vbd_tc,47
8
+ qrmaster-1.0.0.dist-info/top_level.txt,sha256=gYIPZUZwxMzsp0rC4V9nlOLZ-wbPwvsUeb0GauViM20,9
9
+ qrmaster-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ qrmaster = qrmaster.cli:main
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QR Master (https://www.qrmaster.net)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ qrmaster