Topics include httptap, 10 Smart Performance Hacks For Faster Python Code, FastRTC, and Explore Python dependencies with `pipdeptree` and `uv pip tree`

Python Bytes

Michael Kennedy and Brian Okken

#457 Tapping into HTTP

NOV 11, 202528 MIN
Python Bytes

#457 Tapping into HTTP

NOV 11, 202528 MIN

Description

<strong>Topics covered in this episode:</strong><br> <ul> <li><strong><a href="https://github.com/ozeranskii/httptap?featured_on=pythonbytes">httptap</a></strong></li> <li><strong><a href="https://blog.jetbrains.com/pycharm/2025/11/10-smart-performance-hacks-for-faster-python-code/?featured_on=pythonbytes">10 Smart Performance Hacks For Faster Python Code</a></strong></li> <li><strong><a href="https://fastrtc.org?featured_on=pythonbytes">FastRTC</a></strong></li> <li><strong><a href="https://pythontest.com/pipdeptree-uv-pip-tree/?featured_on=pythonbytes">Explore Python dependencies with <code>pipdeptree</code> and <code>uv pip tree</code></a></strong></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=YjoTi2hHZ-M' style='font-weight: bold;'data-umami-event="Livestream-Past" data-umami-event-episode="457">Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/?featured_on=pythonbytes"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://courses.pythontest.com/p/the-complete-pytest-course?featured_on=pythonbytes"><strong>The Complete pytest Course</strong></a></li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy">@[email protected]</a> / <a href="https://bsky.app/profile/mkennedy.codes?featured_on=pythonbytes">@mkennedy.codes</a> (bsky)</li> <li>Brian: <a href="https://fosstodon.org/@brianokken">@[email protected]</a> / <a href="https://bsky.app/profile/brianokken.bsky.social?featured_on=pythonbytes">@brianokken.bsky.social</a></li> <li>Show: <a href="https://fosstodon.org/@pythonbytes">@[email protected]</a> / <a href="https://bsky.app/profile/pythonbytes.fm">@pythonbytes.fm</a> (bsky)</li> </ul> <p>Join us on YouTube at <a href="https://pythonbytes.fm/stream/live"><strong>pythonbytes.fm/live</strong></a> to be part of the audience. Usually <strong>Monday</strong> at 10am PT. Older video versions available there too.</p> <p>Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to <a href="https://pythonbytes.fm/friends-of-the-show">our friends of the show list</a>, we'll never share it.</p> <p><strong>Michael #1: <a href="https://github.com/ozeranskii/httptap?featured_on=pythonbytes">httptap</a></strong></p> <ul> <li>Rich-powered CLI that breaks each HTTP request into DNS, connect, TLS, wait, and transfer phases with waterfall timelines, compact summaries, or metrics-only output.</li> <li>Features <ul> <li><strong>Phase-by-phase timing</strong> – precise measurements built from httpcore trace hooks (with sane fallbacks when metal-level data is unavailable).</li> <li><strong>All HTTP methods</strong> – GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS with request body support.</li> <li><strong>Request body support</strong> – send JSON, XML, or any data inline or from file with automatic Content-Type detection.</li> <li><strong>IPv4/IPv6 aware</strong> – the resolver and TLS inspector report both the address and its family.</li> <li><strong>TLS insights</strong> – certificate CN, expiry countdown, cipher suite, and protocol version are captured automatically.</li> <li><strong>Multiple output modes</strong> – rich waterfall view, compact single-line summaries, or <code>-metrics-only</code> for scripting.</li> <li><strong>JSON export</strong> – persist full step data (including redirect chains) for later processing.</li> <li><strong>Extensible</strong> – clean Protocol interfaces for DNS, TLS, timing, visualization, and export so you can plug in custom behavior.</li> </ul></li> <li>Example:</li> </ul> <p><img src="https://blobs.pythonbytes.fm/httptap-tp-example.png?cache_id=29ee04" alt="img" /></p> <p><strong>Brian #2: <a href="https://blog.jetbrains.com/pycharm/2025/11/10-smart-performance-hacks-for-faster-python-code/?featured_on=pythonbytes">10 Smart Performance Hacks For Faster Python Code</a></strong></p> <ul> <li>Dido Grigorov</li> <li>A few from the list <ul> <li>Use math functions instead of operators</li> <li>Avoid exception handling in hot loops</li> <li>Use itertools for combinatorial operations - huge speedup</li> <li>Use bisect for sorted list operations - huge speedup</li> </ul></li> </ul> <p><strong>Michael #3: <a href="https://fastrtc.org?featured_on=pythonbytes">FastRTC</a></strong></p> <ul> <li>The Real-Time Communication Library for Python: Turn any python function into a real-time audio and video stream over WebRTC or WebSockets.</li> <li>Features <ul> <li>🗣️ Automatic Voice Detection and Turn Taking built-in, only worry about the logic for responding to the user.</li> <li>💻 Automatic UI - Use the <code>.ui.launch()</code> method to launch the webRTC-enabled built-in Gradio UI.</li> <li>🔌 Automatic WebRTC Support - Use the <code>.mount(app)</code> method to mount the stream on a FastAPI app and get a webRTC endpoint for your own frontend!</li> <li>⚡️ Websocket Support - Use the <code>.mount(app)</code> method to mount the stream on a FastAPI app and get a websocket endpoint for your own frontend!</li> <li>📞 Automatic Telephone Support - Use the <code>fastphone()</code> method of the stream to launch the application and get a free temporary phone number!</li> <li>🤖 Completely customizable backend - A <code>Stream</code> can easily be mounted on a FastAPI app so you can easily extend it to fit your production application. See the <a href="https://huggingface.co/spaces/fastrtc/talk-to-claude?featured_on=pythonbytes">Talk To Claude</a> demo for an example of how to serve a custom JS frontend.</li> </ul></li> </ul> <p><strong>Brian #4: <a href="https://pythontest.com/pipdeptree-uv-pip-tree/?featured_on=pythonbytes">Explore Python dependencies with &lt;code>pipdeptree&lt;/code> and &lt;code>uv pip tree&lt;/code></a></strong></p> <ul> <li>Suggested by Nicholas Carsner <ul> <li>We have covered it, but in 2017 on <a href="https://pythonbytes.fm/episodes/show/17/googles-python-is-on-fire-and-simon-says-you-have-cpu-load-pythonically">episode 17.</a></li> </ul></li> <li><a href="https://github.com/tox-dev/pipdeptree/blob/main/README.md#pipdeptree"><strong>pipdeptree</a></strong> <ul> <li>Use <code>pipdeptree --python auto</code> to allow it to read your venv</li> </ul></li> <li><a href="https://docs.astral.sh/uv/reference/cli/#uv-pip-tree"><strong>uv pip tree</strong></a> <ul> <li>Also check out <code>uv pip tree</code> and some useful flags <ul> <li><code>--show-version-specifiers</code> to show the rules</li> <li><code>--outdated</code> notes packages that need updated</li> </ul></li> </ul></li> </ul> <p><strong>Extras</strong></p> <p>Brian:</p> <ul> <li><a href="https://courses.pythontest.com/lean-tdd/?featured_on=pythonbytes">Lean TDD 0.1.1</a> includes an updated intro and another chapter, “Essential Components”</li> <li><a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock&featured_on=pythonbytes">VSCode Peacock Extension</a> - color code your different projects</li> </ul> <p><strong>Joke: <a href="https://x.com/pr0grammerhum0r/status/1956264628960272542?s=12&featured_on=pythonbytes">Sure Grandma</a></strong></p>