Skip to main content

Acronyms

  • Posted

I have to remember a fair number of acronyms at work. I’ve learnt all the ones that I use on a daily basis, but there are plenty of others that I use on an infrequent basis and still need to look up every time.

I spend most of my day in the command-line, and yesterday morning I thought it might be useful to have a CLI tool for managing a list of acronyms. After dinner, I decided to spend an hour or so writing one.

The script is about a hundred lines of Python, and you can find it in a Gist. It’s fairly simple: it stores the acronyms in a JSON file, and provides a slightly prettier interface than just editing the file by hand. It doesn’t have any error handling, but I trust myself not to send in any silly input.

I thought I would just show off how the script works. Here’s how you add an acronym:

$ ./acronyms.py --add NASA
Creating an entry for acronym "NASA".

What does NASA stand for?
National Space and Aviation Association

And what does this mean? (optional)
They make really big rockets and went to the Moon.

Initially I just had the acronym and the expansion fields, but I think the description field will probably be the most important one. I’ll have to write my own definition for all of these terms, and that will probably be much more useful for learning the acronyms than anything else.

Then you can look up acronyms with a case-insensitive search (I’m too lazy to use the shift key), and it shows you any matching acronyms and their definitions:

$ ./acronyms.py -l cs

<pre style="margin: -18px 2px 0px 2px;">CS: Computer Science</pre><pre style="margin: 0px 2px 0px 2px;">CS: Creative Suite</pre><pre style="margin: -18px 2px 0px 2px"> Adobe software for artists.</pre>

You can print in bold in Python using a couple of colour codes around your print statement. New to me, so I’ve learnt a little something while writing this script.

I expect that I’ll know all the company acronyms within a couple more months. But until then, this should serve as a useful crutch for my memory.