Start Using Pandas From the Command Line

Increase your productivity by wrapping recurrent pandas code in a CLI.

Matt
The Startup

--

If you work in the data analysis world, chances are you do a lot of data wrangling. If you use pandas in your data workflow, you’ve probably noticed that you often write the same bits of code.

Although some complex datasets or data exploratory require going to Jupyter notebooks, on the other hand, some datasets require simple processing, going through the process of setting up an environment, and creating a new notebook can be a little overwhelming.

So you probably end up opening it in a spreadsheet. However if spreadsheets are accommodating, they are difficult to automate and do not offer as many features as pandas.

How to take advantage of the features of pandas while keeping the flexibility of spreadsheets?

By wrapping pandas functions in a command-line interface with chainable commands. A command-line interface or CLI allows us to quickly open a terminal and start typing in commands to execute some tasks. Chainable commands mean the result of one command is passed to another, which is particularly interesting in processing data.

In this article, we will use Click to build a CLI. Click is a Python package to quickly build CLI…

--

--