Build the future of communications.
Start Building for Free

Python posts

  • By Neil Ruaro
    How to Create a CLI App for Sending Text Messages Using Twilio SMS and Python How to Create a CLI App for Sending Text Messages Using Twilio SMS and Python

    Texting is one of the most common forms of communication in our modern age. Twilio provides a simple and easy-to-use interface for sending SMS text messages through their SMS API.

    In this tutorial, you'll be using the Twilio SMS API to create your very own CLI texting application using Python and the Typer framework.

    If you're unfamiliar, Typer is a Python library for creating CLI applications. Typer is easy to use, and intuitive to write. It borrows these features from its sister, the FastAPI framework, written by the same author.

    Prerequisites

    In order to complete this tutorial, you will need the following:

    Install Twilio CLI, and setup …

    Read More
  • By Miguel Grinberg
    Record Page Visits to your Flask Website with Twilio Segment Record Page Visits to your Flask Website with Twilio Segment

    If you own or manage a website, you likely want to know what pages your users visit the most. A popular way to obtain this information is to use a web analytics service such as Google Analytics, which uses cookies to keep track of your activity on the site. This approach can be problematic because it isn’t mindful of the online privacy of your site’s visitors. In many jurisdictions, most importantly in the European Union countries, users must provide explicit consent before tracking cookies can be installed on their browsers.

    In this article you are going to learn how to record visits to a Python web application written with the Flask web framework. Page views will be captured in a completely anonymous and private manner and without tracking cookies, which is made possible by the flexibility of the Twilio Segment platform. As an additional benefit, this solution is implemented …

    Read More
  • By Mahlomola Moses Mothogoane
    How to Build a Motion Detection System Using Raspberry Pi and Twilio WhatsApp API How to Build a Motion Detection System Using Raspberry Pi and Twilio WhatsApp API

    Let's say you want to know if there is human movement in your room or house. In this tutorial, you will learn how to build a motion detection system and get notifications when motion is detected in your room via WhatsApp text using the Twilio Programmable Messaging API for WhatsApp. At the end of this tutorial, you will have developed a smart system that will send WhatsApp texts from Raspberry Pi — how awesome!

    Prerequisites

    To complete this tutorial, you need:

    • A Twilio account.
    • An active WhatsApp account, to test the project.
    • A Raspberry Pi (ideally a 3B+ or newer) running Raspberry Pi OS (formerly Raspbian), powered by either a USB cable or wall adapter.
    • A PIR infrared motion sensor (HC-SR501).
    • Three female-to-female jumper wires.

    The HC-SR501 is one of the most used motion sensors. This sensor has two modes, which are single trigger mode and repeatable mode. You …

    Read More
  • By Muyiwa Femi-ige
    How to Automate WhatsApp Messages using Bottle and Twilio Header image for automating whatsapp messages with bottle and twilio tutorial

    Automation is not a new topic in Python. In fact, it is one of the most widespread use cases of Python. To automate is to reduce the need for human intervention by implementing countermeasures or "future" actions that will be in effect for a particular task.

    Automation has a general use, but we will give an insight into its process by showing how to automatically send WhatsApp messages using the Twilio services and Bottle web framework in Python.

    Prerequisites

    This project will show you how to expose a local server to the web using Localtunnel dynamically and how to use a URL as a callback in the Twilio Sandbox for WhatsApp. Thus, you will need the following to achieve this aim:

    Let us begin!

    Getting started

    This section will talk about the following:

    1. Setting up the Twilio WhatsApp Sandbox.
    2. Sending an HTTP …
    Read More
  • By Reshma Sathe
    Schedule a NASA Astronomy Picture of the Day SMS with Python, Django, and Twilio Schedule a NASA Astronomy Picture of the Day SMS with Python, Django, and Twilio

    Astronomy has always been a fascinating subject and has always piqued my interest. I found the NASA Astronomy Picture of the Day and their API during my search. That's when I thought of creating an application that would send me an SMS with the latest picture of the day from the NASA APOD API.

    Instead of reinventing the wheel, I used Twilio SMS, Django, Celery, and the NASA APOD API to create my application. The goal was to:

    • Get a response (astronomy picture of the day and its related information from the NASA APOD API,
    • Create and send an SMS to selected phone numbers using Twilio, and
    • Schedule the SMS to be sent every day at 10 am local time.

    The complete code is available in this repository.

    Prerequisites

    • Python 3.6x or 3.7x. If your operating system does not provide a Python interpreter, you can download …
    Read More
  • By Mia Adjei
    Build a Digital Sticky Notes App with Flask and Svelte Build a Digital Sticky Notes App with Flask and Svelte

    Sticky notes are a great tool for organizing your thoughts or keeping track of things you need to do.

    If you are a student, or anyone thinking about a lot of things at once, there are tons of ways a sticky note could help you out. You can write down the things you need to remember to do, the items on your back-to-school shopping list, notes about what you're learning or thinking, and so much more.

    If you enjoy using paper sticky notes, perhaps you might also be interested in giving digital sticky notes a try. In this tutorial, you'll learn how to build a digital sticky notes application, using Python and Flask for the backend API, JavaScript and Svelte for the UI, and Twilio Sync to store the notes.

    Prerequisites

    Read More
  • By Anthony Dellavecchia
    Summarize Text from Images Using AI, Python, and Twilio Summarize Text from Images using AI, Python, and Twilio

    Content, content, content! Are you overwhelmed by the amount of content you’re asked to read on a daily basis? Don’t you wish you could quickly summarize large chunks of text? It’d be a huge timesaver, especially for college students who read a lot of content!

    In this blog post, I will teach you how to build an app in Python that performs text recognition on photos, summarizes that text, and then sends you a summary via SMS.

    The app in action, text your phone and get a summary

    Here’s a typical use case: you see a large wall of text that you don’t want to read, so you pull out your phone to take a picture of that text, then you receive a SMS with a nice summarization. Boom, time saved!

    Gif of me using the app with a typical use case

    Prerequisites

    Before getting started, it’s important to have the following before moving on:

    Read More
  • By Ravgeet Dhillon
    Booking Appointments with Twilio, Notion, and FastAPI Booking Appointments with Twilio, Notion, and FastAPI

    Most businesses run around the concept of appointments. Appointments allow you to schedule different events for different individuals. For example, before seeing a doctor, it might be necessary to book an appointment. Businesses can leverage the power of WhatsApp to allow their customers to book appointments easily just by sending messages. They can also get updates or check the status of their appointments through WhatsApp messages.

    In this tutorial, you’ll learn to use Twilio’s WhatsApp API with the Notion API and FastAPI to create appointments and get their statuses as well. You will use Notion for storing data, Twilio for sending WhatsApp messages, and FastAPI for API and business logic.

    Prerequisites

    To follow this tutorial, you need the following items:

    • Python 3.6 or newer. If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.
    • A Twilio account. If you are new …
    Read More
  • By Aina Rakotoson
    Alert Relatives to Save Your Property from Fire with Twilio and Raspberry Pi Alert Relatives to Save Your Property from Fire with Twilio and Raspberry Pi

    When facing a danger like fire, everything can go wrong really fast, and you can quickly lose control.

    In these situations, calling for help is crucial. A simple SMS can save your property.

    We can automate it with Twilio Programmable SMS and Raspberry Pi.

    In this article, you will learn how to build a system to alert your relatives by SMS if a fire occurs on your property.

    What do you need?

    Embedded electronics have evolved in these last few decades. Flames can now be detected with an electronic module. These modules can easily be connected to a Raspberry Pi which can be used like a small computer, and you can run programs written with high-level programming languages on it.

    To build the fire detection system, you’ll need :

    Read More
  • By Johnny Nguyen
    How to Send an Email with Notion, SendGrid, and Python How to Send an Email with Notion, SendGrid, and Python

    Notion is a useful tool for project management and note taking. Users can easily create new pages and databases for managing their projects. For example, you could create pages for email templates and then add a database for a mailing list. Why shouldn't you also be able to send an email with Notion?

    In this post, you will learn how to use Notion to create email templates and an email mailing list. Using Python and SendGrid, you will make a console program, complete with argument parsing, so you can effectively send your emails.

    Prerequisites

    To continue with this tutorial, you will need:

    After you …

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