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 →

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.

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 →