Running a Python Script in Docker

brown and red shipping containers

When I first started working with Docker, one of the things I needed to figure out was how to run a Python script efficiently within a container. Docker is a fantastic tool for containerizing applications, and running Python scripts in this environment can simplify dependencies and make your projects more portable. In this post, I’ll

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