Parsing Connection Strings in Python

A person holding a cup of coffee in their hands

Connection strings are central to working with databases, APIs, and other systems where authentication, schema, and server details need to be specified. A connection string combines these details into one, convenient string—like a condensed map to the exact data you’re trying to reach. However, while a connection string packs a lot of essential information, sometimes

Securely Handling Sensitive and Non-Sensitive Inputs in Python

An empty street with a tall building in the background

When working with Python applications, managing environment variables for things like passwords, API keys, and other configurations is essential. Environment variables keep sensitive information secure and flexible, allowing you to adjust configurations without modifying your code. But what if the necessary environment variable isn’t set, or you want an alternative, like a CLI prompt, to

Command-Line Arguments in Python with argparse

a large building with a large pipe on the side of it

When it comes to writing versatile and user-friendly Python scripts, knowing how to handle command-line arguments is invaluable. These small, powerful tools enable users to control how a script behaves without modifying code. Python’s argparse library is built precisely for this purpose, and it simplifies the process significantly. In this guide, I’ll walk you through

Connecting to Trino with Python: A Complete Guide to Secure Queries with SSL and Parameters

a small white rabbit eating a green piece of food

When I first started working with Trino (formerly PrestoSQL), I found it powerful but somewhat tricky to connect from Python while handling authentication, SSL, and dynamic query parameters. After spending some time figuring it out, I decided to share what I’ve learned to help anyone facing the same challenges. If you’re trying to connect to

Temporary Files in Python: A Handy Guide to tempfile

person pouring coffee in mug

As a Python developer, there are times when I need to create temporary files—whether it’s for storing intermediate data, testing, or simply handling temporary storage requirements. But here’s the catch: manually creating and deleting files can become cumbersome. That’s where Python’s tempfile module swoops in to save the day! This built-in module offers a simple