Using Python for Automation

One definition of automation is: “using computer scripts or programs to reduce human intervention or workload”. At Award Solutions we use the Python language to automate repetitive tasks for customers in the telecom space. In a recent Python class, I had some students who were looking for more examples to leverage Python to automate some of their repetitive duties. While I can’t share the proprietary information surrounding those scenarios, I wrote a Hypertext Live Streaming (HLS) validator as an example of how Python can be used for automation.

Apple developed the HLS specification to deliver media content (audio, video, etc.) via a more cost-effective web format than traditional streaming. The HLS format chops video files into small “media segments”, and supports adaptable bit rates for optimal playback during variable network congestion conditions. The net result is a catalog of playlist files that a content provider needs to verify, and that is where the automation comes into play.

While it is possible for a technician to verify playlist files manually this is an eyesight test which is subject to error. Considering that each content offering may have several playlist files each defining varying media quality, the verification of those files can be mind-numbingly repetitive. True, there is some overhead to writing the code for an automation script up front, but the ability to run that program repeatedly and free the technician to spend time on more thought provoking tasks is a benefit. Python is a flexible language that is relatively easy to learn. I have used it in other scenarios to generate and publish Microsoft Word or Adobe PDF files from information stored in spreadsheets. Some of my colleagues use Python to automatically generate graphs to visualize their data.

If you need an example of how Python can be leveraged for automation peruse the web, or look at the following repository:

https://github.com/jhuckestein/Python-HLS

With a little thought and ingenuity I’m sure you can find your own repetitive tasks that could be automated!

Reference:

“HTTP Live Streaming Draft-Pantos-Http-Live-Streaming-23.” Edited by R. Pantos, IETF.org, Apple Inc., 22 May 2017, tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.1.2.