﻿ Posts tagged with Flask - Twilio Blog

• By Johnny Nguyen
How to Find Your Classes with Twilio SMS, Python, and Airtable

You can always count on the fact that I will get lost the first week of each college semester. I can have a physical copy of my schedule, my schedule set as my phone wallpaper, or a web page with my schedule pulled up. However, it can still take me a while to sift through webpages, find the building, search up the building, open up the directions, and then find the classroom.

With the new school semester coming around the corner, this problem came to mind during a coding workshop, and I programmed it in less than an hour. In this tutorial, you will learn how to use Twilio SMS, Python, and Airtable to send you an SMS message of your classes with directions for the day, so you can find your classes on time.

## Prerequisites

To continue with this tutorial, you will need:

• By Johnny Nguyen
How to Build a Linear Regression Model Using Twilio SMS and Python

Linear regression is a common and useful approach for modeling the relationship between a dependent variable and one or more independent variables. Its use spans many applications, such as economics, medicine, and science. Whether you're an expert in a lab or a beginner on a laptop, linear regression is a way to achieve valuable results built on relatively simple formulas.

In this tutorial, you will implement a linear regression model using Python and scikit-learn. To add more functionality, you will use Flask and Twilio's Programmable Messaging API to help you build your data and make predictions from the convenience of your phone.

## Prerequisites

To continue with this tutorial, you will need:

• Python 3.10 or higher installed on your machine.
• A Twilio account. If you haven’t yet, sign up for a free Twilio trial.
• A Twilio phone number. After having an account, you will need to obtain a Twilio phone …
• By Johnny Nguyen
Build a Travel Recommender with Twilio MMS, Flask, and Airtable

Are you looking for your next travel destination, but can't decide on where to travel to? For National Anti-Boredom Month, consider building this travel recommendation bot to make the decision for you.

In this tutorial, you will use Twilio's Programmable Messaging API, Python, Flask, and Airtable to build a travel recommendation bot. After messaging the bot, the bot will reply with an image and location of your next travel destination.

## Prerequisites

To continue with this tutorial, you will need:

Build a Weather Chatbot with Twilio SMS, Python, and Flask

Weather apps are extremely helpful in a world where weather is becoming increasingly unpredictable. After all, even though you might be able to look out the window and see whether it's raining or not, you might not know what the temperature or UV index is without checking a website or app.

In this tutorial, you will learn how to build a little chatbot that can tell you the weather in your area or where you are planning to be, as well as remind you what you might want to bring along with you if you go outside.

Let's get started!

## Prerequisites

• By Johnny Nguyen
Build an Urban Dictionary Emoji/Slang Sentiment Analyzer with Python and Twilio SMS

Emojis and slang have, not only different nuances, but vastly different interpretations between groups of people. For instance, do your coworkers misappropriate the 🙂 emoji? How is it that 🙃 has more positive sentiment than 🙂?

In this tutorial, you will build a sentiment analyzer with Python and Twilio SMS using Urban Dictionary as a reference for the most recent slang.

## Prerequisites

To continue with this tutorial, you will need:

## Obtain a Twilio Phone Number

If you haven’t obtained a phone number from Twilio already, …

• By Miguel Grinberg
Verify Your Users on WhatsApp with Python and Twilio

Twilio Verify is an easy-to-use service for user verification through numeric codes. This service now includes support for WhatsApp (in public beta, as of June 2022). In this tutorial, you’ll learn how to implement a WhatsApp user verification flow in a Python and Flask application.

## Requirements

To work on this tutorial you will need the following items:

## Create a Twilio Verify service

To use Twilio Verify in an application, a Verify service must be created first. Open the …

• By Miguel Grinberg
Vérifiez vos utilisateurs sur WhatsApp avec Python et Twilio

Twilio Verify est un service facile à utiliser pour la vérification utilisateur à l'aide de codes numériques. Ce service inclut désormais la prise en charge de WhatsApp (en version bêta publique, à partir de juin 2022). Dans ce tutoriel, vous apprendrez à implémenter un flux de vérification utilisateur WhatsApp dans une application Python et Flask.

## Prérequis

Pour suivre ce tutoriel, vous aurez besoin des éléments suivants :

## Créer un service Twilio Verify

Pour …

• By Miguel Grinberg
Serverless Twilio Webhooks on AWS with Lambda Function URLs

Serverless platforms are ideal for the deployment of webhooks such as those used by Twilio services, as they provide flexibility and scalability without the complications involved in hosting on your own infrastructure.

In this tutorial you are going to learn how to create a Twilio SMS webhook written in Python using AWS Lambda, with its brand new function URLs feature.

## Requirements

To work on this tutorial you will need the following items:

• A Python 3 interpreter compatible with AWS Lambda (as of April 2022, Python 3.6, 3.7, 3.8 or 3.9). If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.
• By Sam Agnew
Using Event Webhooks for Emails with Twilio SendGrid in Python

When sending emails with Twilio SendGrid, sometimes you want to be able to keep track of the status of these emails, such as when a recipient opens the message or reports it as spam. This is made possible by the use of Event Webhooks. Let's walk through how to use Python and Flask to track the status of emails that you send.

## Prerequisites and dependencies

Make sure you have the following before moving on:

• Python 3 installed on your machine
• A free SendGrid account
• An email address to test out this project
• A domain on which you will receive emails. For the purposes of this article, I’m going to use yourdomainhere.com. You will need to replace it with your own domain name.

Here is a guide you can follow for setting up your development environment if you are going to be doing more web development with Python in …

• By Miguel Grinberg
Transcribe your Phone Calls to Text in Real Time with Twilio and Vosk

In this tutorial, you are going to learn how to implement live transcription of phone calls to text. The phone calls will be routed through a Twilio phone number, and we will use the Media Streams API to stream the incoming audio to a small WebSocket server built using Python. Once in your server, the audio stream will be passed to Vosk, a lightweight open-source speech recognition engine that runs locally on your computer, with support for many languages.

## Requirements

To work on this tutorial, you will need: