This is my personal blog. I sometimes update it….

Using the New PyREPL in VSCode

PyREPL in VSCode is Possible The PyREPL I use the REPL all the time and I’m enjoying the new PyREPL. If you haven’t yet moved to Python 3.14, you should - PyREPL is another compelling reason to update. The new PyREPL has been available since Python 3.13, and replaces the original C-based REPL with a Python-based implementation (PyREPL). You can read about the PyREPL in ‘PEP 762 – REPL-acing the default REPL’. ...

October 27, 2025 · Jonathan B

Using YT-DLP With UVX

Introduction YT‑DLP is a fast, actively maintained command-line tool for downloading audio and video from many sites. I use it to extract audio from videos for offline listening on walks. This post shows a simple, reproducible workflow using UV/UVX so you can run YT‑DLP without installing it system‑wide, plus a small PowerShell helper script to make converting downloads easier. What you’ll find here: Prerequisites and quick troubleshooting tips How I run YT‑DLP via UVX A ready-to-use PowerShell script Legal/Terms reminder: only download content you have the right to store or that is permitted by the content provider’s terms of service. ...

October 12, 2025 · Jonathan B

VSCode Terminal Does Not Match the Windows System PATH

If your Windows PATH environment variable in your VSCode terminal does not match the one in your terminal outside of VSCode, it’s probably this setting in VSCode: terminal.integrated.enablePersistentSessions Uncheck this or set it to be false, and restart VScode and all should be right. By default, this option persists your terminal sessions across reloads (VSCode Terminal Advanced Docs). That might be handy, so re-enabling it afterwards would be okay if you really wanted it, but for me I’ve disabled it in my user settings: ...

August 29, 2025 · Jonathan B

Reading the Windows Registry with Python: A Case Study Using WinReg

Table of Contents Table of Contents 1. Introduction 2. Background: What is the Windows Registry? Structure of the Windows Registry 3. The Problem with Sample Code: Lessons from PEP 514 4. Exploring the Registry: Exporting and Analysing Data Example: Analysing Exported Registry Files Example summary of my registry key statistics 5. Building a Better Registry Reader in Python Getting Keys and Values Traversing Subkeys via Recursion Printing Results Arguments with ArgParse Issues Found Final Tidy 6. Practical Example: Using the Script Command-line Examples Script Examples Example 1 Example 2 7. Key Takeaways Reading a Registry Value Writing to the Registry Deleting a Registry Key or Value 8. Try It Yourself 1. Introduction Curiosity often leads to some of the most interesting projects. After reading about PEP 514 in the Astral UV documentation, I discovered that Python installations on Windows are registered in the Windows Registry. Intrigued, I tried the sample code from PEP 514, only to find it lacking. This post documents my journey to build a more robust, flexible Python script for reading Windows Registry values. Hopefully this may be useful for someone. ...

August 1, 2025 · Jonathan B

Modernizing Python Development: My Switch to UV

Summary of Common UV Commands # Install UV - multiple options available ###################################################### # Windows powershell -ExecutionPolicy ByPass -c "irm <https://astral.sh/uv/install.ps1> | iex" winget install --id=astral-sh.uv -e # Linux/macOS curl -LsSf "https://astral.sh/uv/install.sh" | less brew install uv # Python pipx install uv # alternative is pip uv --version # or 'uv self version' uv --help # --help can be used with all commands uv self update # Update UV itself # Install and Manage Python ###################################################### uv python install # Install latest Python version uv python install 3.10.5 # Install specific Python version uv python install --default # Add python.exe to $HOME\.local\bin\ uv python install --reinstall # Reinstall uv-managed Python versions uv python list # List available Python versions uv python list --managed-python # Only list managed Python versions uv python list --no-managed-python # Only list system Python versions uv python upgrade 3.14 # Install the latest patch version uv python uninstall 3.10.5 # Uninstall version uv python find 3.14 # Show path for a specific python.exe uv run where <exe_name> # Show path(s) of all <exe_name>.exe uv python pin 3.14 # Use a specific version in the _current directory_ # Creates a .python-version file # UV Uninstall uv cache clean # Optional, but recommended rm -r "$(uv python dir)" # Optional, but recommended rm -r "$(uv tool dir)" # Optional, but recommended rm $HOME\.local\bin\uv*.exe # Windows rm ~/.local/bin/uv ~/.local/bin/uvx # Linux/macOS # Run Python ###################################################### uv run python # REPL with default version uv run <script>.py # Default version uv run -p 3.14 <script>.py # Specific version, --python alias uv run python [py_option] # Standard Python cmd options uv run --with <pkg> <script>.py # Include dependency package # Multiple --with allowed # Can use UVX, but take care when trying to run pytest, mypy, etc uvx python@3.14 <script>.py # Specific version # Create Virtual Environment (Venv) ###################################################### uv venv # Use the default Python version uv venv <venv_name> # Specify the Venv name uv venv --python 3.14 # Specify the Python version for the Venv uv venv --seed # Add the PiP module to the Venv # Activate Venus .venv\Scripts\activate # PowerShell source .venv/bin/activate # Linux/macOS deactivate # Add Dependencies - normally into current venv ###################################################### uv add <pkg1,...> # Add one or more dependencies to the project # Version Specifiers allowed, e.g. rich>13.9.1 uv add -r requirements.txt # Add all in the given `requirements.txt` uv remove <pkg1,...> # Remove dependencies from the project # Requires 'pyproject.toml' uv tree # View the dependency tree uv tree --outdated --depth 1 # View latest available versions uv sync # Sync environment from uv.lock uv lock # Create uv.lock (happens automatically anyway) uv sync ---upgrade # Edit pyproject.toml to change package version, then... # 'pyproject.toml' [dependency-groups] uv add --dev <pkg1,...> # Add to the development group uv add --group test <testpkg> # Add to user named `test` group uv add <azurepkg> --optional azure # Add Optional to 'azure' group # Remove is the same ordering, # e.g. "uv remove --dev tox coverage" # Manage Python packages with a pip-compatible interface ###################################################### uv pip list # List packages installed uv pip install <pkg1 pkg2..> # Install package into an environment uv pip install -p 3.14 <pkg> # Install into specific version # Install packages into the system Python environment (non-virtual) uv pip install --system <pkg> # Allow UV to modify an `EXTERNALLY-MANAGED` Python installation uv pip install --system --break-system-packages <pkg> # Create UV Project Areas ###################################################### uv init # Create in CWD, default proj type = --app uv init <proj_name> # Create a default named project uv init --bare # Only create a pyproject.toml uv init --app # Application project - this is the default uv init --package # Package project uv init --lib # Library project uv version # _Project_ version, as listed in the pyproject.toml # Build Project ###################################################### uv build # Build Lib/Pkg using UV or specified Build-Backend # UV Tools ###################################################### # Run Tools uvx <tool> # UVX is an alias for 'uv tool run' uvx <tool@version> # Specify Tool Version: <tool@version> uvx <tool>@latest # Latest Tool Version uv cache clean # Deletes all entries in the cache # Install Tools uv tool install <tool> # [install | uninstall | upgrade] uv tool install <tool>@latest # Install latest version of <tool> uv tool update-shell # Ensure Tool Exe on path (if not already) # Tool Info uv tool dir # Installed source uv tool dir --bin # Installed executable uv tool list # List Installed Tools Introduction Python development is evolving rapidly, and UV is at the forefront of this transformation. In this post, I wanted to document my experience switching to UV, why and I how I’ve started the move to a modern workflow. ...

July 27, 2025 · Jonathan B

Modernizing Python Development: Linting and Formatting with Ruff

Introduction What are Linters and Formatters Linters Formatters Why You Should Use Them What is Ruff? Getting Started with Ruff Installation steps Basic CLI Usage ruff check --output-format concise .\example.py ruff format .\example.py Configuration Rules Integrating Ruff into your workflow CLI IDE Pre-Commit GitHub Action Tips Conclusion Further Reading Introduction Python development is evolving—today, code quality and consistency are more important than ever. Strict is the new cool. Tools like Black have made opinionated formatting mainstream, and the need for readable, maintainable, and error-free code is greater than ever—especially as projects grow and AI-driven code/tools become more prevalent. ...

July 18, 2025 · Jonathan B

Test Post

This is a test post to my Github Pages. Example Image should be here:

July 12, 2025 · Jonathan B