<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Alex Lukens</title><link>https://alukens.com/tags/python/</link><description>Recent content in Python on Alex Lukens</description><generator>Hugo</generator><language>en-us</language><copyright>© alukens.com</copyright><lastBuildDate>Sun, 16 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://alukens.com/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>qr-reader-cli: A QR Code Reader for the Terminal</title><link>https://alukens.com/posts/qr-reader-cli/</link><pubDate>Sun, 16 Aug 2026 00:00:00 +0000</pubDate><guid>https://alukens.com/posts/qr-reader-cli/</guid><description>&lt;p&gt;&lt;a href="https://github.com/alexdlukens/qr-reader-cli"&gt;qr-reader-cli&lt;/a&gt; is a Python CLI that decodes QR codes from an image file, a URL, or a webcam — no phone required.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Image file with a single QR code&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;qr-cli -i ./ticket.png
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Multiple codes in one image&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;qr-cli -i ./batch.jpg --many-ok
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Save the decoded data as JSON&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;qr-cli -i ./ticket.png -o result.json
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Live webcam reading, straight from the terminal&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;qr-cli
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The engine is OpenCV&amp;rsquo;s &lt;code&gt;QRCodeDetector&lt;/code&gt;, with an optional WeChat detector (&lt;code&gt;--use-wechat&lt;/code&gt;) for harder-to-decode codes. On the terminal side it leans on &lt;code&gt;rich&lt;/code&gt; and &lt;code&gt;rich_pixels&lt;/code&gt; to render the live webcam feed as pixels right in the console — no separate window. If you have multiple webcams plugged in, &lt;code&gt;questionary&lt;/code&gt; pops an interactive picker. Decoded output goes to stdout, or as JSON to a file when a QR contains file data.&lt;/p&gt;</description></item><item><title>snap-store-tui: Browse the Snap Store From Your Terminal</title><link>https://alukens.com/posts/snap-store-tui/</link><pubDate>Sun, 25 Jan 2026 00:00:00 +0000</pubDate><guid>https://alukens.com/posts/snap-store-tui/</guid><description>&lt;p&gt;The existing official workflow for navigating the snap store requires using a GUI (App Center) or bare &lt;code&gt;snap&lt;/code&gt; commands. I created the snap-store-tui project to provide a middle ground.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/alexdlukens/snap-store-tui"&gt;snap-store-tui&lt;/a&gt; is a terminal UI for navigating the &lt;a href="https://snapcraft.io/"&gt;Snap Store&lt;/a&gt;, built with the &lt;a href="https://github.com/textualize/textual/"&gt;Textual&lt;/a&gt; framework.&lt;/p&gt;
&lt;p&gt;The TUI covers the day-to-day store workflow without leaving the terminal:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Browse and search snaps against the Snap Store API&lt;/li&gt;
&lt;li&gt;View snap details, including channel listings&lt;/li&gt;
&lt;li&gt;Install and uninstall snaps directly from the UI&lt;/li&gt;
&lt;li&gt;See what&amp;rsquo;s installed on your machine&lt;/li&gt;
&lt;li&gt;Open a snap&amp;rsquo;s store page in your browser&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In order to interact with the Snap daemon, Snap Store, I created a Python library &lt;a href="https://pypi.org/project/snap-python/"&gt;snap-python&lt;/a&gt;. This was built with the help of generated Pydantic models from the JSON schemas in the &lt;a href="https://api.snapcraft.io/docs/"&gt;Snap Store API docs&lt;/a&gt;. I used &lt;code&gt;datamodel-codegen&lt;/code&gt; to generate the Pydantic models from the schemas.&lt;/p&gt;</description></item></channel></rss>