Your terminal is more powerful than you think.
Python was widely known as beginner-friendly and versatile. But little discussed was how it had an awesome set of command-line tools that could turbocharge the workflow of developers, data wonks, sysadmins, or anyone who happens to spend so much time at the command prompt.
Here in this post, I've compiled a list of 5 crazily useful Python CLI tools that will aid you in automating processes, increasing productivity, as well as perhaps having some fun in the process. Dive right in.
1. httpie โ A Human-Friendly curl Alternative
If you frequently interact with APIs, httpie is a game-changer. It turns raw curl commands into clean, readable HTTP requests with syntax highlighting and formatted JSON responses.
Installation
pip install httpieExample
http GET https://api.github.com/users/octocat
This Supports JSON natively, Intuitive syntax and Built-in color output.
2. glances โ Real-Time System Monitoring
Want to keep an eye on how well your system performs? glances provides an at-a-glance display of CPU, memory, disk I/O utilization, as well as network utilization-all in current time.
Installation
pip install glancesExample
Just type glance in your terminal, that gives you an at-a-glance view of CPU, memory, disk I/O, and network usage โ all in real time.
glances
This is Cross-platform, Web-based interface available and Can be run in server-client mode for remote monitoring.
3. rich-cli โ Beautify Anything in the Terminal
Whether it's JSON, Markdown, or tracebacks, rich-cli displays them with colors, formatting, and even charts.
Installation
pip install rich-cliExample
To syntax highlight a file enter rich followed by a path. Many file formats are supported.
rich loop.py
Makes terminal output actually pleasant to read.
4. howdoi โ Stack Overflow in Your Terminal
Ever Googled "python list comprehension syntax" for the 100th time? howdoi fetches answers from Stack Overflow right in your terminal.
Installation
pip install howdoiExample
$ howdoi print stack trace python
> import traceback
>
> try:
> 1/0
> except:
> print '>>> traceback <<<'
> traceback.print_exc()
> print '>>> end of traceback <<<'
> traceback.print_exc()
$ howdoi convert mp4 to animated gif
> video=/path/to/video.avi
> outdir=/path/to/output.gif
> mplayer "$video" \
> -ao null \
> -ss "00:01:00" \ # starting point
> -endpos 10 \ # duration in second
> -vo gif89a:fps=13:output=$outdir \
> -vf scale=240:180
$ howdoi create tar archive
> tar -cf backup.tar --exclude "www/subf3" wwwGet coding help instantly without leaving your terminal.
5. csvkit โ Power Tools for CSV Files
If Excel isn't your thing, csvkit brings spreadsheet-level power to the command line.
Installation
pip install csvkitExample
Convert Excel to CSV:
in2csv data.xls > data.csvConvert JSON to CSV:
in2csv data.json > data.csvPrint column names:
csvcut -n data.csvQuery with SQL:
csvsql --query "select name from data where age > 30" data.csv > new.csvQuery, explore, and clean CSV files with elegance.
Final Thoughts
It doesn't need to be cold or intimidating. With the right software, it gets to be an artistic space-a productivity playground.
Either you debug APIs, you deal with projects management or just want to copy-paste just a little bit faster, Python's CLI ecosystem has something for you.
So fire up Terminal, instill some of these, and witness how much of the daily hassle you could automate. Your future self will appreciate it.
๐ฌ Got a favorite Python CLI tool I missed? Drop it in the comments โ I'm always hunting for new toys.
โ๏ธ Follow for more developer tools, automation tips, and Pythonic goodness.