Build the future of communications.
Start Building for Free

Flask posts

  • By Sam Agnew
    Using Event Webhooks for Emails with Twilio SendGrid in Python Copy of C04 Blog Text.png

    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 …

    Read More
  • By Miguel Grinberg
    Transcribe your Phone Calls to Text in Real Time with Twilio and Vosk  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.

    Live transcription of phone calls demonstration

    Requirements

    To work on this tutorial, you will need:

    Read More
  • By Sam Agnew
    Mars Rover Emails with Python and Twilio SendGrid Copy of C01 Blog Text.png

    NASA has a bunch of awesome APIs which give you programmatic access to the wonders of space. I think the Mars Rover Photos API in particular is really amazing as you can use it to see what kind of pictures the Mars Curiosity rover has been taking.

    Let’s build an app using the Mars Rover API with Twilio SendGrid, Python, and Flask to make it so that we can send an email and receive back pictures from Mars.

    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 …

    Read More
  • By Naomi Pentrel
    Use Twilio Video to Create a Dog Camera Dog Cam

    There are multiple apps and services out there that you can use as a dog cam. However, most of these apps and services require you to pay for new devices or a subscription (or both!). When I recently adopted a puppy, I used Twilio Video and an old phone to create my own free dog cam.

    In this blog post, I’ll show you how to build your own dog cam using:

    1. a Twilio account – sign up for free
    2. Python 3.x
    3. the micro web framework Flask
    4. the Twilio Python helper library
    5. ngrok - sign up for free
    6. An old phone or tablet

    Features

    For the Dog Cam, there were a few features I wanted:

    Free or low cost solution

    Existing dog cameras mostly require you to spend money on a subscription or new hardware. What I wanted was a free or low cost solution that can run on any internet-connected …

    Read More
  • By August Allard
    Create Secret Santa Matches Using Python Flask and Twilio SMS Create Secret Santa matches using Python Flask and Twilio SMS

    For the second year in a row, my family decided to embrace the “secret santa” method of giving gifts at Christmas. Rather than everyone getting a gift for everyone else, which can be expensive and time consuming, each person’s name is put in a box and we each draw one name from the box. The name we draw is the person we give a gift to, up to a certain dollar amount that we’ve all agreed on in advance.

    This year, my family is spread all over the United States so it wasn’t possible to draw names from a box. Instead, I thought it would be fun to create my own Flask application that would match people up and notify each person of their gift recipient using Twilio SMS.

    Follow along with the tutorial below, or clone the GitHub repository if you’re in a rush!

    Prerequisites

    Read More
  • By Miguel Grinberg
    Send Scheduled Emails from Python and Flask with Twilio SendGrid Send Scheduled Emails from Python and Flask with Twilio SendGrid

    Twilio SendGrid eliminates many of the complexities of sending email. In a previous tutorial, you learned how to use SendGrid’s SMTP server to send emails to your users from a Python and Flask application. But how do you schedule your emails so that they are sent at a specific time?

    In this short tutorial you will learn how to use SendGrid’s email scheduling options, which will save you from having to implement your own background scheduling.

    Requirements

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

    • Python 3.6 or newer. If your operating system does not provide a Python 3.6+ interpreter, you can go to python.org to download an installer.
    • A free Twilio SendGrid account. If you are new to Twilio Sendgrid you can create a trial account. With a trial account you can send 100 emails per day forever.

    Create a Flask project

    Find an …

    Read More
  • By Mark Lewin
    Create a Cold War-Era Numbers Station with Twilio Voice and Python Flask Create a Cold War-Era Numbers Station with Twilio Voice and Python Flask

    Put on your fedora and dark glasses, because you’re about to become a Cold War-era numbers station operator!

    What is a numbers station, I hear you ask? A numbers station is a radio station in the shortwave frequency band that periodically reads out a sequence of numbers, popularly believed to be a secret code for intelligence officers listening for encrypted information. Numbers stations appeared during World War I and are likely to have become much more prevalent during the Cold War.

    In the past, the numbers were often spoken in what sounded like a creepy voice, probably due to the poor radio transmission quality available at the time. You can listen to a few recent examples of numbers station transmissions on the Crypto Museum's website. Some numbers stations survive to this very day.

    Since many people enjoy cracking secret codes, I thought it would be fun to show you …

    Read More
  • By Ashutosh Hathidara
    Automatically Send Birthday Wishes with Python Flask and WhatsApp Automatically Send Birthday Wishes with Python Flask and WhatsApp

    Do you forget to send birthday wishes to your friends and loved ones? I do, and it usually results in being scolded by my fiancée! I’ve often wished for a software program that could send birthday wishes on my behalf.

    In this tutorial, we will create this exact end-to-end system. We will use Twilio's What’sApp API for sending the messages, the Flask web framework for the web server, and we will run messaging jobs periodically using APScheduler. We’ll also deploy the Flask application to AWS so it can be deployed resiliently and at scale.

    The complete code for this tutorial is available in this Github repository.

    Prerequisites

    • A Twilio account. (Sign up with this link and receive an additional $10 credit.)
    • The WhatsApp application installed on your mobile phone
    • An activated WhatsApp Sandbox (be sure to follow the setup instructions).
    • Your Account SID and Auth Token, found …
    Read More
  • By Diane Phan
    Utiliser la reconnaissance d'images avec l'API Twilio WhatsApp Comment utiliser la reconnaissance d'images avec l'API Twilio WhatsApp

    Le concept de reconnaissance des images peut sembler être un défi, mais avec l'aide de API de reconnaissance d'images de Clarifai, le code peut prédire le contenu d'une image donnée et déterminer les concepts pour décrire l'image, ainsi que la valeur de prédiction de la précision de la classification de l'image.

    Dans cet article, nous allons vous expliquer comment développer un programme Python fonctionnel pour identifier le contenu multimédia à l'aide de l'API Twilio WhatsApp API, API Clarifai, et Flask.

    Configuration requise pour le tutoriel

    Pour créer ce projet, vous devez disposer des éléments suivants :

    • Python 3.6 ou version ultérieure. Si votre système d'exploitation ne fournit pas d'interpréteur Python, vous pouvez vous rendre sur python.org pour télécharger un programme d'installation.
    • ngrok est un utilitaire pratique pour connecter la version de développement de notre application Python exécutée sur votre système à une URL publique …
    Read More
  • By Diane Phan
    Python、Flask、Twilio Verifyを使用してメールアドレスを認証する方法 How-to-Verify-an-Email-Address-Using-Python-Flask-and-Twilio-Verify-JP

    このBlogはDeveloper Voices Teamに所属するDiane Phanこちらで執筆した記事を日本語化したものです。

    Python、Flask、Twilio Verifyを使用してメールアドレスを認証する方法

    大半のWebアプリケーションでは、サインアッププロセス中に、ユーザーのメールアドレスを受け付けます。不正アカウントの作成を防ぐには、指定されたメールアドレスでユーザーがメールを受信できることを確認するという方法が常に有効です。

    Twilio Verifyは、SMS、音声通話、メールを介して数値コードを送信する、というユーザー確認に使いやすいサービスです。このチュートリアルでは、メール認証フローをFlask、Twilio Verify、SendGridを使って実現する方法について説明します。

    Flask - Verify - SendGrid

    チュートリアルの要件

    • Python 3.6以降 - オペレーティングシステムにPythonインタープリターがない場合は、python.orgからインストーラーをダウンロードしてください
    • Twilioアカウント - 初めてTwilioを利用する場合は、こちらをクリックして無料アカウントを作成してください。このリンクを用いてアカウントを作成すると有料アカウントへのアップグレード時に使える10ドルのクレジットを進呈します。トライアルアカウントの制限についてはこちらを確認してください
    • SendGridアカウント。こちらをクリックして無料アカウントを作成してください。このアカウントでは1日最大100通のメールを送信できます

    SendGridの設定

    メ …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.