Command line script for creating a PNG punchcard graph of your bash history.
Python Makefile
Switch branches/tags
Nothing to show
Latest commit 5ddeea4 Dec 11, 2015 @askedrelic askedrelic make clean updates

Punchcard Bash History

How I work at home (~3 years ago) Home usage

My current work machine (loving that 10-6) Work usage

Visualize when you are using bash (and hopefully getting work done).



  • Python 2.6/2.7
  • the Bash HISTTIMEFORMAT variable to be set, so your bash usage is recorded in a useful manner

Install from PyPI via pip:

$ pip install bashpunchcard


Set these in your .bashrc or .bash_profile, and reopen your shell.

export HISTTIMEFORMAT='%Y-%m-%d %H:%M:%S - '
export HISTSIZE=50000

If you type some commands then do history, you should see your bash history with a line number, timestamp, and the command.


Once installed and once you have bash history to graph, you can run it from the command line:

$ bashpunchcard
Wrote new punchcard to /Users/askedrelic/historychart.png

$ bashpunchcard -h
usage: Command line script for creating a PNG punchcard graph of your bash history
    [-h] [-W WIDTH] [-H HEIGHT] [-2] [-s] [-t TITLE] [-c COLORS] [-i INPUT]
    [-o OUTPUT] [-v]

optional arguments:
-h, --help            show this help message and exit
-W WIDTH, --width WIDTH
                        chart width (default: 800)
-H HEIGHT, --height HEIGHT
                        chart height (default: 300)
-2, --24              24-hour clock
-s, --sunday          Sunday at top
-t TITLE, --title TITLE
                        chart title
-c COLORS, --colors COLORS
                        colors of days, top to bottom (default:
-i INPUT, --input INPUT
                        input filename (default:
-o OUTPUT, --output OUTPUT
                        output image filename (default: historychart.png)
-v, --version         show program's version number and exit

Ideas and most code from:


MIT, See attached LICENSE