You’ve just finished building your first Python command-line app. Or maybe your second or third. You’ve been learning Python for a while, and now you’re ready to build something bigger and more complex, but still runnable on a command-line. Or you are used to building and testing web applications or desktop apps with a GUI, but now are starting to build CLI applications.
In all these situations and more, you will need to learn and get comfortable with the various methods for testing a Python CLI application.
While the tooling choices can be intimidating, the main thing to keep in mind is that you’re just comparing the outputs your code generates to the outputs you expect. Everything follows from that.
In this tutorial you’ll learn four hands-on techniques for testing Python command-line apps:
Getting up-and-running with Amazon’s new machine learning-enabled camera
tl;dr It’s awesome. Get one.
At the end of 2017, Amazon announced DeepLens, a camera with specialized hardware that allows developers to deploy machine learning and computer vision models to “the edge,” and integrate the data it collects with other AWS services.
On a whim, I put in a one-click order on Prime (devices started shipping just last week); it arrived a couple days later and just hours from unboxing — with one or two minor hiccups — I got it up-and-running and integrated with other AWS services. I’ve been pleasantly surprised, to say the least.
After creating the Free Wtr bot using Tweepy and Python and this code, I wanted a way to see how Twitter users were perceiving the bot and what their sentiment was. So I created a simple data analysis program that takes a given number of tweets, analyzes them, and displays the data in a scatter plot.
Many data analysis, big data, and machine learning projects require scraping websites to gather the data that you’ll be working with. The Python programming language is widely used in the data science community, and therefore has an ecosystem of modules and tools that you can use in your own projects. In this tutorial we will be focusing on the Beautiful Soup module.
Beautiful Soup, an allusion to the Mock Turtle’s song found in Chapter 10 of Lewis Carroll’s Alice’s Adventures in Wonderland, is a Python library that allows for quick turnaround on web scraping projects. Currently available as Beautiful Soup 4 and compatible with both Python 2.7 and Python 3, Beautiful Soup creates a parse tree from parsed HTML and XML documents (including documents with non-closed tags or tag soup and other malformed markup).
In this tutorial, we will collect and parse a web page in order to grab textual data and write the information we have gathered to a CSV file.