Publishing your Python package in your Gitlab Package Registry

I joined iib in January and since the beginning it was clear that I’d have a lot of fun automating a few manual process. The development team is formed by three persons: the CTO, another developer and me. The team is small but step by step we’re going towards the technical excellence we want. :) One of the things that needed automation was the release of an internal library. The process to install it was basically git pull + python setup.py install. Since we have many other things to do, this problem was waiting a little longer to be solved. But the things became ugly when I had to setup a test pipeline for Airflow (must say that now I understand why the most famous blog post on this topic is called Data’s Inferno: 7 Circles of Data Testing Hell with Airflow - but this discussion I’ll leave for another day). ...

April 23, 2021 · 3 min

Replace Django ORM Function

Today I learned: Replace function in Django’s ORM. Sometimes we stumble across a bug or a change in the business logic that forces us to change the value of a column based on another from the same table. I thought that Django might have this solved and indeed it has through the database functions. In my case I had to update the value of a column replacing its current value and, at the same time, using the value of another column. This was possible with little code using the function Replace. ...

April 2, 2021 · 1 min

Google Sheets as Hugo backend

Who hasn’t needed to create a quick website with repetitive data structures, but thought that adding a database and all the communication logic would be too much? Static site generators are quick options, and nowadays it’s possible to put one online in minutes. However, when we need to make constant modifications to the site’s content, it becomes difficult to do so without modifying the code. In my case, I needed to share the responsibility of making modifications to the site’s data with a non-technical person who was already accustomed to online spreadsheets. ...

September 8, 2020 · 8 min

Saving My Mom's Pictures: Building a Backup WhatsApp Chatbot With Python, Flask, Dropbox and Twilio

My mom isn’t really into tech and here and there she has trouble with her phone: “it’s out of space, again!”. She, like everybody else, uses WhatsApp everyday to solve business issues, to ask when we’re coming back home, and to receive and send tons of pictures. For her, backups aren’t a trivial task, so I decided to help her on this quest. I had an idea: building a WhatsApp bot to backup her pictures to my Dropbox. Instead of deleting pictures, she only would have to forward her pictures to our bot. How does it sound? ...

April 7, 2020 · 1 min

If-else workflow with Celery Tasks

Sometimes we need to link tasks according to the outcomes, similar to an if/else flow. With Celery is possible to do it using link and link_error. To give you an idea, let’s say that we need to send an important SMS to our customer. If this succeed, we should sync this SMS to our CRM tool; if something went wrong, we should contact IT right away. We can do it by linking our send_sms task to other tasks. We use link for tasks that must be executed after our main task and link_error for tasks that should be executed if something goes wrong. ...

February 22, 2019 · 1 min