diff --git a/IMGs/PyTexas_QR_Code_IMG_4.gif b/IMGs/PyTexas_QR_Code_IMG_4.gif new file mode 100644 index 0000000..88b8b5e Binary files /dev/null and b/IMGs/PyTexas_QR_Code_IMG_4.gif differ diff --git a/IMGs/PyTexas_QR_Code_IMG_5.gif b/IMGs/PyTexas_QR_Code_IMG_5.gif new file mode 100644 index 0000000..1dc600d Binary files /dev/null and b/IMGs/PyTexas_QR_Code_IMG_5.gif differ diff --git a/README.md b/README.md index c465baa..a4c2dd7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +This README has not yet been upated as of 20260408. But will be and will be done through lessons from [here](https://realpython.com/python-generate-qr-code/). + +--- + # Python Development Toolkit A comprehensive template and toolkit for Python projects with AI-assisted workflows, specification-driven development, and security-first patterns. diff --git a/hello_world_qr.png b/hello_world_qr.png new file mode 100644 index 0000000..cb2b7ca Binary files /dev/null and b/hello_world_qr.png differ diff --git a/pyproject.toml b/pyproject.toml index f1eb959..00208b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,13 @@ [project] -name = "repo-template-python" +name = "python-qr" version = "0.1.0" -description = "Template repo for Python projects and AI code generation support." +description = "A simple QR code generator for Python." readme = "README.md" requires-python = ">=3.14" -dependencies = [] +dependencies = [ + "qrcode-artistic>=3.0.2", + "segno>=1.6.6", +] [dependency-groups] dev = [ diff --git a/requirements.txt b/requirements.txt index 8b13789..1a4d19c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ - +segno diff --git a/src/basic_qrcode.py b/src/basic_qrcode.py new file mode 100644 index 0000000..422a937 --- /dev/null +++ b/src/basic_qrcode.py @@ -0,0 +1,86 @@ +# basic_qrcode.py + +import segno +from pathlib import Path + +def generate_qr_code_txt( + data: str = "Hello, World", + filename: str = "hello_world_qr.png", + scale: int = 1, border: int = 4, + light: str = "white", dark: str = "black", + quiet_zone: str = "white", data_dark: str = "" + ) -> None: + # default 5x5 pixels in size + qr_code = segno.make_qr(data) + if data_dark: + qr_code.save(filename, + scale=scale, + border=border, + light=light, + dark=dark, + quiet_zone=quiet_zone, + data_dark=data_dark) + else: + qr_code.save(filename, + scale=scale, + border=border, + light=light, + dark=dark, + quiet_zone=quiet_zone) + +def generate_GIF_qr_code( + gif_loc: str, + data: str = "Hello, World", + filename: str = "hello_world_qr.png", + scale: int = 1, border: int = 4, + light: str = "white", dark: str = "black", + quiet_zone: str = "white", data_dark: str = "", + ) -> None: + """ + Takes in a segno QR code and generates a GIF version of it. + """ + qr_code = segno.make(data, error="h") + qr_code.to_artistic(background=gif_loc, + target=filename, + scale=scale, + border=border, + light=light, + dark=dark, + quiet_zone=quiet_zone) + +if __name__ == "__main__": + script_dir = Path(__file__).parent + project_root = script_dir.parent + gif_path_1 = project_root / "IMGs" / "PyTexas_QR_Code_IMG_4.gif" + gif_path_0 = project_root / "IMGs" / "PyTexas_QR_Code_IMG_5.gif" + + generate_qr_code_txt(scale=5, border=1, light="black", dark="hotpink", + data="https://pytexas.org/2026") + + generate_GIF_qr_code(scale=10, border=1, light="black", filename="contest-1.gif", + data="https://canva.link/PyTexas2026-TalkGame", + gif_loc=str(gif_path_1)) + + generate_GIF_qr_code(scale=10, border=1, light="black", filename="deck-1.gif", + data="https://github.com/ProsperousHeart/mkdocs-jupyterlite-template-repo", + gif_loc=str(gif_path_0)) + + generate_GIF_qr_code(scale=10, border=0, light="black", filename="contest-0.gif", + data="https://canva.link/PyTexas2026-TalkGame", + gif_loc=str(gif_path_0)) + + generate_GIF_qr_code(scale=10, border=0, light="black", filename="deck-0.gif", + data="https://github.com/ProsperousHeart/mkdocs-jupyterlite-template-repo", + gif_loc=str(gif_path_0)) + + generate_GIF_qr_code(scale=10, border=1, light="black", filename="form-1.gif", + data="https://forms.gle/xMbzVjo4iPQGf1QT8", + gif_loc=str(gif_path_1)) + + generate_GIF_qr_code(scale=10, border=0, light="black", filename="form-0.gif", + data="https://forms.gle/xMbzVjo4iPQGf1QT8", + gif_loc=str(gif_path_0)) + + generate_GIF_qr_code(scale=10, border=0, light="black", filename="repo-site-0.gif", + data="https://resume.prosperousheart.com/mkdocs-jupyterlite-template-repo/", + gif_loc=str(gif_path_0)) \ No newline at end of file diff --git a/uv.lock b/uv.lock index 69ba580..e50e3c0 100644 --- a/uv.lock +++ b/uv.lock @@ -98,6 +98,39 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191, upload-time = "2023-12-10T22:30:43.14Z" }, ] +[[package]] +name = "pillow" +version = "12.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/21/c2bcdd5906101a30244eaffc1b6e6ce71a31bd0742a01eb89e660ebfac2d/pillow-12.2.0.tar.gz", hash = "sha256:a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5", size = 46987819, upload-time = "2026-04-01T14:46:17.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/98/4595daa2365416a86cb0d495248a393dfc84e96d62ad080c8546256cb9c0/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3adc9215e8be0448ed6e814966ecf3d9952f0ea40eb14e89a102b87f450660d8", size = 4100848, upload-time = "2026-04-01T14:44:48.48Z" }, + { url = "https://files.pythonhosted.org/packages/0b/79/40184d464cf89f6663e18dfcf7ca21aae2491fff1a16127681bf1fa9b8cf/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:6a9adfc6d24b10f89588096364cc726174118c62130c817c2837c60cf08a392b", size = 4176515, upload-time = "2026-04-01T14:44:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/b0/63/703f86fd4c422a9cf722833670f4f71418fb116b2853ff7da722ea43f184/pillow-12.2.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:6a6e67ea2e6feda684ed370f9a1c52e7a243631c025ba42149a2cc5934dec295", size = 3640159, upload-time = "2026-04-01T14:44:53.588Z" }, + { url = "https://files.pythonhosted.org/packages/71/e0/fb22f797187d0be2270f83500aab851536101b254bfa1eae10795709d283/pillow-12.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2bb4a8d594eacdfc59d9e5ad972aa8afdd48d584ffd5f13a937a664c3e7db0ed", size = 5312185, upload-time = "2026-04-01T14:44:56.039Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8c/1a9e46228571de18f8e28f16fabdfc20212a5d019f3e3303452b3f0a580d/pillow-12.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:80b2da48193b2f33ed0c32c38140f9d3186583ce7d516526d462645fd98660ae", size = 4695386, upload-time = "2026-04-01T14:44:58.663Z" }, + { url = "https://files.pythonhosted.org/packages/70/62/98f6b7f0c88b9addd0e87c217ded307b36be024d4ff8869a812b241d1345/pillow-12.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22db17c68434de69d8ecfc2fe821569195c0c373b25cccb9cbdacf2c6e53c601", size = 6280384, upload-time = "2026-04-01T14:45:01.5Z" }, + { url = "https://files.pythonhosted.org/packages/5e/03/688747d2e91cfbe0e64f316cd2e8005698f76ada3130d0194664174fa5de/pillow-12.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7b14cc0106cd9aecda615dd6903840a058b4700fcb817687d0ee4fc8b6e389be", size = 8091599, upload-time = "2026-04-01T14:45:04.5Z" }, + { url = "https://files.pythonhosted.org/packages/f6/35/577e22b936fcdd66537329b33af0b4ccfefaeabd8aec04b266528cddb33c/pillow-12.2.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cbeb542b2ebc6fcdacabf8aca8c1a97c9b3ad3927d46b8723f9d4f033288a0f", size = 6396021, upload-time = "2026-04-01T14:45:07.117Z" }, + { url = "https://files.pythonhosted.org/packages/11/8d/d2532ad2a603ca2b93ad9f5135732124e57811d0168155852f37fbce2458/pillow-12.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4bfd07bc812fbd20395212969e41931001fd59eb55a60658b0e5710872e95286", size = 7083360, upload-time = "2026-04-01T14:45:09.763Z" }, + { url = "https://files.pythonhosted.org/packages/5e/26/d325f9f56c7e039034897e7380e9cc202b1e368bfd04d4cbe6a441f02885/pillow-12.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9aba9a17b623ef750a4d11b742cbafffeb48a869821252b30ee21b5e91392c50", size = 6507628, upload-time = "2026-04-01T14:45:12.378Z" }, + { url = "https://files.pythonhosted.org/packages/5f/f7/769d5632ffb0988f1c5e7660b3e731e30f7f8ec4318e94d0a5d674eb65a4/pillow-12.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:deede7c263feb25dba4e82ea23058a235dcc2fe1f6021025dc71f2b618e26104", size = 7209321, upload-time = "2026-04-01T14:45:15.122Z" }, + { url = "https://files.pythonhosted.org/packages/6a/7a/c253e3c645cd47f1aceea6a8bacdba9991bf45bb7dfe927f7c893e89c93c/pillow-12.2.0-cp314-cp314-win32.whl", hash = "sha256:632ff19b2778e43162304d50da0181ce24ac5bb8180122cbe1bf4673428328c7", size = 6479723, upload-time = "2026-04-01T14:45:17.797Z" }, + { url = "https://files.pythonhosted.org/packages/cd/8b/601e6566b957ca50e28725cb6c355c59c2c8609751efbecd980db44e0349/pillow-12.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:4e6c62e9d237e9b65fac06857d511e90d8461a32adcc1b9065ea0c0fa3a28150", size = 7217400, upload-time = "2026-04-01T14:45:20.529Z" }, + { url = "https://files.pythonhosted.org/packages/d6/94/220e46c73065c3e2951bb91c11a1fb636c8c9ad427ac3ce7d7f3359b9b2f/pillow-12.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:b1c1fbd8a5a1af3412a0810d060a78b5136ec0836c8a4ef9aa11807f2a22f4e1", size = 2554835, upload-time = "2026-04-01T14:45:23.162Z" }, + { url = "https://files.pythonhosted.org/packages/b6/ab/1b426a3974cb0e7da5c29ccff4807871d48110933a57207b5a676cccc155/pillow-12.2.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:57850958fe9c751670e49b2cecf6294acc99e562531f4bd317fa5ddee2068463", size = 5314225, upload-time = "2026-04-01T14:45:25.637Z" }, + { url = "https://files.pythonhosted.org/packages/19/1e/dce46f371be2438eecfee2a1960ee2a243bbe5e961890146d2dee1ff0f12/pillow-12.2.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d5d38f1411c0ed9f97bcb49b7bd59b6b7c314e0e27420e34d99d844b9ce3b6f3", size = 4698541, upload-time = "2026-04-01T14:45:28.355Z" }, + { url = "https://files.pythonhosted.org/packages/55/c3/7fbecf70adb3a0c33b77a300dc52e424dc22ad8cdc06557a2e49523b703d/pillow-12.2.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5c0a9f29ca8e79f09de89293f82fc9b0270bb4af1d58bc98f540cc4aedf03166", size = 6322251, upload-time = "2026-04-01T14:45:30.924Z" }, + { url = "https://files.pythonhosted.org/packages/1c/3c/7fbc17cfb7e4fe0ef1642e0abc17fc6c94c9f7a16be41498e12e2ba60408/pillow-12.2.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1610dd6c61621ae1cf811bef44d77e149ce3f7b95afe66a4512f8c59f25d9ebe", size = 8127807, upload-time = "2026-04-01T14:45:33.908Z" }, + { url = "https://files.pythonhosted.org/packages/ff/c3/a8ae14d6defd2e448493ff512fae903b1e9bd40b72efb6ec55ce0048c8ce/pillow-12.2.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a34329707af4f73cf1782a36cd2289c0368880654a2c11f027bcee9052d35dd", size = 6433935, upload-time = "2026-04-01T14:45:36.623Z" }, + { url = "https://files.pythonhosted.org/packages/6e/32/2880fb3a074847ac159d8f902cb43278a61e85f681661e7419e6596803ed/pillow-12.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e9c4f5b3c546fa3458a29ab22646c1c6c787ea8f5ef51300e5a60300736905e", size = 7116720, upload-time = "2026-04-01T14:45:39.258Z" }, + { url = "https://files.pythonhosted.org/packages/46/87/495cc9c30e0129501643f24d320076f4cc54f718341df18cc70ec94c44e1/pillow-12.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fb043ee2f06b41473269765c2feae53fc2e2fbf96e5e22ca94fb5ad677856f06", size = 6540498, upload-time = "2026-04-01T14:45:41.879Z" }, + { url = "https://files.pythonhosted.org/packages/18/53/773f5edca692009d883a72211b60fdaf8871cbef075eaa9d577f0a2f989e/pillow-12.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f278f034eb75b4e8a13a54a876cc4a5ab39173d2cdd93a638e1b467fc545ac43", size = 7239413, upload-time = "2026-04-01T14:45:44.705Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e4/4b64a97d71b2a83158134abbb2f5bd3f8a2ea691361282f010998f339ec7/pillow-12.2.0-cp314-cp314t-win32.whl", hash = "sha256:6bb77b2dcb06b20f9f4b4a8454caa581cd4dd0643a08bacf821216a16d9c8354", size = 6482084, upload-time = "2026-04-01T14:45:47.568Z" }, + { url = "https://files.pythonhosted.org/packages/ba/13/306d275efd3a3453f72114b7431c877d10b1154014c1ebbedd067770d629/pillow-12.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6562ace0d3fb5f20ed7290f1f929cae41b25ae29528f2af1722966a0a02e2aa1", size = 7225152, upload-time = "2026-04-01T14:45:50.032Z" }, + { url = "https://files.pythonhosted.org/packages/ff/6e/cf826fae916b8658848d7b9f38d88da6396895c676e8086fc0988073aaf8/pillow-12.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:aa88ccfe4e32d362816319ed727a004423aab09c5cea43c01a4b435643fa34eb", size = 2556579, upload-time = "2026-04-01T14:45:52.529Z" }, +] + [[package]] name = "platformdirs" version = "4.3.8" @@ -160,9 +193,13 @@ wheels = [ ] [[package]] -name = "repo-template-python" +name = "python-qr" version = "0.1.0" source = { virtual = "." } +dependencies = [ + { name = "qrcode-artistic" }, + { name = "segno" }, +] [package.dev-dependencies] dev = [ @@ -184,6 +221,10 @@ dev = [ ] [package.metadata] +requires-dist = [ + { name = "qrcode-artistic", specifier = ">=3.0.2" }, + { name = "segno", specifier = ">=1.6.6" }, +] [package.metadata.requires-dev] dev = [ @@ -203,3 +244,25 @@ dev = [ { name = "pygments", specifier = "==2.19.1" }, { name = "pytest", specifier = "==8.4.0" }, ] + +[[package]] +name = "qrcode-artistic" +version = "3.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pillow" }, + { name = "segno" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4f/cf/5fff014b4ba48c7e985343bc59827e134a11bae71227c15a47bee3b999aa/qrcode-artistic-3.0.2.tar.gz", hash = "sha256:eb71f12673c89f638cf7252554a74ecbe4a22f1ce15920caa53da75a48c181f4", size = 9336, upload-time = "2023-11-27T18:31:24.824Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/10/62/81f17a375319b3d0242a3b93dd2d30ce16e5592544e1762f8c2e7514c9d2/qrcode_artistic-3.0.2-py3-none-any.whl", hash = "sha256:a2aa751a7f0220767f70842cceec206b21f9207478b9612d468273a1f46429ae", size = 7636, upload-time = "2023-11-27T18:31:22.776Z" }, +] + +[[package]] +name = "segno" +version = "1.6.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1c/2e/b396f750c53f570055bf5a9fc1ace09bed2dff013c73b7afec5702a581ba/segno-1.6.6.tar.gz", hash = "sha256:e60933afc4b52137d323a4434c8340e0ce1e58cec71439e46680d4db188f11b3", size = 1628586, upload-time = "2025-03-12T22:12:53.324Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/02/12c73fd423eb9577b97fc1924966b929eff7074ae6b2e15dd3d30cb9e4ae/segno-1.6.6-py3-none-any.whl", hash = "sha256:28c7d081ed0cf935e0411293a465efd4d500704072cdb039778a2ab8736190c7", size = 76503, upload-time = "2025-03-12T22:12:48.106Z" }, +]