Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.

#376 Every dunder method in a Python Lockbox

March 26, 2024 00:32:04 27.26 MB Downloads: 0
Topics covered in this episode:
Watch on YouTube

About the show

Sponsored by ScoutAPM: pythonbytes.fm/scout

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.

Brian #1: 🤖 On Robots.txt

Michael #2: niquests

  • Requests but with HTTP/3, HTTP/2, Multiplexed Connections, System CAs, Certificate Revocation, DNS over HTTPS / TLS / QUIC or UDP, Async, DNSSEC, and (much) pain removed!
  • Niquests is a simple, yet elegant, HTTP library. It is a drop-in replacement for Requests, which is under feature freeze.
  • See why you should switch: Read about 10 reasons why

Brian #3: Every dunder method in Python

  • Trey Hunner
  • Sure, there’s __repr__(), __str__(), and __init__(), but how about dunder methods for:
    • Equality and hashability
    • Orderability
    • Type conversions and formatting
    • Context managers
    • Containers and collections
    • Callability
    • Arithmetic operators
    • … and so much more … even a cheat sheet.

Michael #4: Lockbox

  • Lockbox is a forward proxy for making third party API calls.
  • Why? Automation or workflow platforms like Zapier and IFTTT allow "webhook" actions for interacting with third party APIs.
  • They require you to provide your third party API keys so they can act on your behalf. You are trusting them to keep your API keys safe, and that they do not misuse them.
  • How Lockbox helps: When a workflow platform needs to make a third party API call on your behalf, it makes a Lockbox API call instead. Lockbox makes the call to the third party API, and returns the result to the workflow platform.

Extras

Brian:

Michael:

Joke: Windows Certified