CLI written in Python to fast exploration of csv files with or without additional packages

Manuel Gijón Agudo
2 min readMay 28, 2021

I created this script to obtain a fast visualization of the structure of a .csv file without exit the command line and (if I need it) without installing additional packages.

Introduction

This small tool is part of my personal toolbox (I have a collection of scripts that are in costant change and evolution) that I use daily as a Machine Learning Engineer and Software Developer and I usually use it in combination with the package Rich. I have already talked about a few ways I use this packages in this blog (here the link).

Table generated using the additional package “Rich” of Iris dataset

I added a non-additional packages mode on the script because sometimes the server or computer where I have the .csv storaged had not had Rich installed (for instance, sometimes I generate files using a pipeline inside a server and I do not want install there anything else or I do not have permissions to do it).

Comparation between the basic mode and the one that use Rich.

In addition to this I have also added other options that I use frequently, such as limiting the number of samples displayed or change the delimiter if I need it.

Help menu.

Code

Conclusions

This script is in constant change and all contributions are welcomed, here is a link to the Github repository where I save the content of this posts. Of course feel free to use and modify this code, I am sure there are a lot of improvements ready to be done!

Any feedback would be welcome. Thanks for reading!

Manuel G.

--

--

Manuel Gijón Agudo

Machine Learning Engineer and Associate Professor at Polytechnic University of Catalonia's School of Informatics (Data Mining). BSc and MSc in Mathematics.