Skip to main content

90 posts tagged with "python"

python tag description

View All Tags

Choosing the right Python environment and package management tool in 2025

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Choosing the right Python environment and package management tool in 2025 depends on your project's complexity and your team's workflow. The tools available can be categorized into two main groups: those that manage Python versions (pyenv, asdf) and those that manage project dependencies (venv, virtualenv, Poetry). Combining these tools is often the most effective approach.

Python's @property vs. @classmethod - A No-Nonsense Guide

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

When you're diving into Python's Object-Oriented Programming (OOP) features, decorators like @property and @classmethod pop up all the time. They might seem similar at first glance, but they serve fundamentally different purposes. Getting them straight is key to writing clean, Pythonic code.

Let's cut through the noise and get straight to what they do and when you should use them.

Managing database queries in Django applications and where save the queries

· 8 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

As a Django app grows, managing database queries effectively is crucial for maintainability, performance, and testability. Storing them haphazardly is a recipe for disaster. The best place to store your queries is on custom Model Managers and QuerySets. This approach keeps your logic organized, reusable, and closely tied to the data it operates on. Here are the main variants for storing your queries, from the least recommended to the best practice.

Python Doctests: The Complete Guide to Documentation-Driven Testing

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Writing documentation is essential, but code examples in documentation frequently rot over time as codebases evolve. Python's built-in doctest module solves this problem by allowing you to write executable code examples directly inside your docstrings. The system verifies that the actual function output matches your documented example output.

By combining doctest (for living documentation correctness) and pytest (as your primary test runner), you get a symbiotic testing strategy that guarantees your code works and your documentation is always truthful.

This guide covers when to use doctests, how to write them, the various ways to execute them, and how to optimize your developer workflow in VS Code and Gitpod.

How to Easily Write Docstrings in Python Without a Headache (Using VSCode)

· 4 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Writing docstrings in Python can feel like a chore - especially with the odd formatting involving triple quotes, >>> signs, and parameter blocks. But clear, standardized docstrings are critical for both readability and maintainability.

If you're using VSCode (Visual Studio Code), you're in luck. With a few extensions and configurations, you can make writing professional, PEP 257-compliant docstrings painless.

What is Behaviour Driven Developement in Python

· 14 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

We're constantly striving for higher quality, faster delivery, and closer collaboration. In the realm of API development, where contracts and interactions are paramount, these goals often feel like a constant uphill battle. This is where Behavior-Driven Development (BDD) emerges not just as a testing methodology, but as a powerful paradigm for designing, developing, and validating robust Python API systems.

What is Design-First paradigm in Python

· 11 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

We've all seen projects spiral when API design is an afterthought. It's a common trap: dive straight into coding, then realize downstream that your API is clunky, inconsistent, and a nightmare to integrate with. This is precisely why the Design-First (API-First) paradigm isn't just a buzzword; it's a critical methodology for building scalable, maintainable, and truly collaborative API systems, especially within the Python ecosystem.

Test-Driven Development (TDD) - Writing Code That's Correct by Design

· 10 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Not only Shift-Left mantra matters

The mantra of "Shift Left" has echoed through the halls of software development for years now, and for good reason. The core idea is simple yet powerful: move testing, quality, and security considerations as early as possible in the development lifecycle. It's about catching problems when they're small and cheap to fix, not when they're gargantuan headaches in production. But as a lead engineer who's seen a few projects through the trenches, I've come to realize that "Shift Left" isn't the destination; it's the starting point.

To truly build robust, maintainable, and high-quality software, especially in a dynamic language like Python, we need to embrace a set of development paradigms that not only support but enhance the "Shift Left" philosophy. These aren't just buzzwords; they are methodologies that, when adopted, fundamentally change how we approach writing code for the better.

Testing in Python for Beginners. Using `unittest` and `pytest` with Fun Examples

· 3 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Writing tests in Python helps ensure that your code works correctly. In this guide, we'll use two popular testing tools: the built-in unittest module and the third-party library pytest. We'll walk through both using examples related to vegetables and AI model names.