Avoid wrapper packages over command line CLIs

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the dependencies category.

Last Updated: 2024-11-23

I was writing a Python program to mix audio. To do this, I downloaded a python library that wrapped the sox command line tool. I was seduced by the familiar python API and colorful HTML docs into believing that this python wrapper would be easier to use than talking to the command line program directly.

But this turned out to be a bad decision. The Python library added weird errors not present in the original. It used different terminology for core concepts. Its docs were out of date compared to the core sox stuff. And the extra layer of abstraction was a lot of overhead.

Lesson

In most cases, use the original package instead of some library that wraps it. Interfacing with other programs is incredibly easy in Python, Ruby, etc.