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 →

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 →

Inspecting HTTP requests

If some day you wondered how to inspect a HTTP request to try out some webhook or even an SalesForce outbound message (😅), I have a tip for you: requestbin + ngrok. The requestbin is an open source project with this purpose. It’s self hosted! You can run it locally using Docker or even deploy it to a free Heroku dyno. If you decide to go local, ngrok can help as well.

Read More →

[python drops] Pathlib

The module pathlib is around since Python 3.4 but I must confess that I’ve started to use it a short time ago. For those who are listening this name for the first time, pathlib is an Object-oriented filesystem paths module; in other words, a module with few classes to help you to manipulate paths in a pratical way. Each class has a proper use and if you wanna dive into it, I suggest to take a look in the docs.

Read More →

[python drops] f-strings

In this Python Drops episode we’re going to talk about f-strings, also known as Literal String Interpolation. This feature was added on Python 3.6 and the goal is making the String interpolation more readable. Interpolation is a fancy name to mount/create/construct a String from data you want to: a variable, a method return and so on. Before it, the common way to interpolate Strings looked like this: Format Strings (example from the oficial documentation)

Read More →