"python" posts

Often developers need to deal with data in various different formats and JSON, short for JavaScript Object Notation, is one of the most popular formats used in web development. This is the syntax that the JavaScript language uses to denote objects.

As a Python developer, you may notice that this looks eerily similar to a Python dictionary. There are several different solutions to working with JSON in Python, and more often than not this data is loaded into a dictionary.

For this post, we are going to use the following modified JSON data from NASA's Astronomy Picture of the Day API. Navigate to where you want to run the example code, create a file called apod.json and add the following to it:

{"copyright":"Yin Hao","date":"2018-10-30","explanation":"Meteors have been shooting out from the constellation of Orion. This was expected, as October is the time of year for ...

Do you ever have so many things to do that you can’t even decide where to begin? This is me, all the time. So every once in a while, when I’m a bit overwhelmed by all the tasks I have to do, I make my code decide for me. In this tutorial, we’ll build a system that responds to a text with a to-do item. I’m an avid Trello user so we’ll use the Trello API and Twilio API to send tasks via SMS.

First, we have to set our environment up. This guide was written in Python 3.6. If you haven't already, download Python, Pip and Ngrok. Next we will install virtualenv to create and activate your virtual environment by entering the followings command in your command-line:

This article will guide beginner Python developers on creating Twitter bots. You will learn the Twitter API while building a your bot and then you will deploy the bot to a cloud platform. The Twitter bot tweets quotes randomly selected from a Random Quotes API service.

Development Environment

To build our Twitter bot, we first need to set up our Python development environment and install the required packages that are needed for us to follow along with this tutorial.

Application Programming Interfaces (APIs) can be a great way to programmatically gather or distribute data. API creation really distills down to creating a set of routes that receive requests and return useful data. For example, visiting this page may be easy for a person to read, but it’s harder for a computer program to extract the information it may need. An API can return just the information a program needs.

In this tutorial, we’ll make an API of I Love Dogs, a basic Flask site I created to show cool articles and photos about different types of dogs.

The site is organized by sections the user can visit to learn about different topics. For this API, we’ll create an endpoint so that when a user pings it with a topic they want to get content resources for, it returns a list of resources.

If you are looking for a beginner Twilio project or a new texting buddy, this tutorial is for you! Using the Twilio and CleverBot APIs you will make a Flask app that texts CleverBot, which is an AI you can chat with that learns from its conversations.

Getting Started

You will need a Twilio account with a phone number that can send and receive SMS. In the console navigate to the "Buy a Number" page. Make sure to check off SMS under capabilities and then hit the search button. Any number will do, so feel free to pick one that speaks to you!

You will also need a CleverBot API key. You will have to input payment information to use the API. Luckily, the first month is free! Just remember to cancel your subscription if you don't plan on using it after this project.

If you're working on an urgent project in GitHub with other developers, it's handy to get immediate notifications by SMS. However, there is no SMS option out of the box! So I said, “Enough is enough; I'll start my own notification system!”

In this tutorial, I'll walk you through the steps of building out the beginnings of a notification system for GitHub pull requests. More specifically, we will use the GitHub and Twilio APIs in Python to send texts notifying you when a new pull request has been submitted.

Getting Started

First, we have to set our environment up. This guide was written in Python 3.6. If you haven't already, download Python and Pip. Next we will install virtualenv to create and activate your virtual environment by entering the followings command in your command-line:

As a new homeowner and dad of two toddlers that leave every light in the house on, I recently switched to Commonwealth Edison’s Hourly Pricing Program, which means I shifted the amount I pay for electricity from a fixed price rate to a variable rate.

Most people pay a fixed rate for the price of electricity. In northern Illinois, it’s 7.2 cents per kilowatt hour (kWh), but it’s different for different parts of the country. Many electric companies now offer the option to switch to a variable rate, which is based on the actual real-time market price of energy.

According to ComEd: “These prices vary from hour to hour and day to day according to the actual market price of power. Higher prices are most likely to occur on weekday afternoons during the summer.” Since my wife and I both work, and the kids are at ...

If you've ever wondered about the story behind your favorite emoji, this app is for you. We'll build an interactive bot to give us more information about just what 💁 is doing. With the Twilio API for WhatsApp and Emojipedia 👌😍 we can easily query this information on demand.

🌅 Getting started

Before we can dig into some code, make sure that your Python and Flask development environment is setup. If you haven't done so already,

💬 Setting Up Twilio API ...

My first real paid job was working at the local library in high school. This was perfect because I love reading. With a monthly book stipend company perk and more time to read in my post-grad life, I've started using Goodreads to find new books and to keep track of what I've already read.

This post will go over how to parse the Goodreads quotes page. We'll target popular book quotes and quotes with a specific tag received as input from a WhatsApp message and then send a random quote as an outbound WhatsApp message.

Setting Up Twilio API Sandbox for WhatsApp

At the moment, only approved business accounts can use Twilio's WhatsApp API so we need to use the Twilio API Sandbox for WhatsApp to play around. Let's go on over to the Sandbox in our Twilio console. To activate it we must choose a Sandbox number, agree to ...

Puns are awesome and one easy way to come up with puns is to combine two different words. This is called a portmanteau. Let’s build a WhatsApp bot that gives you portmanteaus for certain words that you message it, so you can come up with better puns on the fly!