I don’t have a private PyPI, what now?

The situation is as follows: the company you work for is small, and you want to publish a Python package internally. However, you don’t want to pay for a service to do this or add a new tool. Although this may seem like a specific situation, we can say that it can happen quite frequently. In Brazil, literally 99% of companies are small businesses. According to Forbes, the statistic is exactly the same in the USA (the first country that appeared in the search :)).

Read More →

Printing Tracebacks

Sometimes you’re in a situation where you need to debug something that is inside a piece of code like this: try: [...] except Exception as e: [...] An option would be printing e but it will show only the exception message, instead of the traceback. You can solve this by adding: import traceback try: [...] except Exception as e: [...] print(''.join(traceback.format_exception(None, e, e.__traceback__))) It will show the exception and the traceback.

Read More →

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.

Read More →

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.

Read More →

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.

Read More →