Data Classes in Python

Python data classes are a relatively new feature that was added in Python 3.7. They are used to create classes that are primarily used to store data. A data class is similar to a regular Python class, but it comes with additional functionality and built-in methods that make it easier to work with structured data.…

Read more

Abstract Classes in Python

When it comes to writing reusable and extensible code in Python, abstract classes are an essential tool in your arsenal. Abstract classes define a set of methods that a subclass must implement, but it doesn’t provide an implementation for those methods itself. This feature makes them a powerful way to enforce certain behavior while also…

Read more

SQL Alchemy Inheritance

Inheritance is a core concept when we are developing with an object oriented approach. Developing models/entities with SQL Alchemy or any mapper is no different. We can have all the benefits of OOP -inheritance, composition etc.- and transition/translate them to database design. In this post we will go over a brief example on how to…

Read more

Building ETL pipelines with ORM

ORM

One of the most common tasks for anyone working in software is to work at some point with persisted data. That means that the data is permanently stored either in some database (Relational or NoSQL) either even in some files. In this post, we will examine how we can interact with databases – more specifically…

Read more

Handling Slowly Changing Dimensions in ETL/BI – From theory to implementation

Slowly Changing Dimensions in Data Warehousing are dimensions that will change over time slowly – instead of changing in regular intervals. Think for example a customer’s address. This is an attribute that it will be not changing on the regular data refreshes, but it could change at some point in the future. In Data Warehouses…

Read more

Using Redis as a cache mechanism with Python

There are a lot of scenarios where we want to reduce the number of requests we do either towards our database either towards a third party API. Those may include reducing the usage cost -either referring to the need of scaling our systems, either to the usage of an external API for a specific number…

Read more

Facade Pattern in Python

The Facade design pattern belongs to the structural design patterns and provides a unified interface to a set of interfaces. It is commonly used in apps written in OOP languages and it intends to provide a convenient interface to the client, thus the latter avoid dealing with complex parts (subsystems). Keep in mind although that,…

Read more

Bubble Sorting in Python

Bubble Sort is the simplest sorting algorithm. It works by changing positions in the adjacent elements if they are in the wrong order. Basic Example Assume we have the following list of integers: (32, 5, 12, 9, 72) With bubble sort, we will traverse through the list and compare the adjacent elements, as many times…

Read more

Python Generators

Generators are a special kind of function that returns a lazy iterator. These are objects that you can loop over like a list. Unlike lists, lazy iterators do not store their data in memory. Before diving in generators, we need first to elaborate a bit on the iterators concept and the yield keyword. Iterators An iterator is…

Read more

Python Decorators

A decorator is a design pattern in Python that allows a user to add new functionality to an existing function or object without modifying its structure. Decorators are usually called before the definition of a function you want to decorate. Functions as First-Class Objects Before diving into decorators we need to understand how functions work in Python where they are first-class objects.…

Read more