A simple artist inventory with Google Docs and Python

The goal, a basic spreadsheet with images in cells.

The goal, a basic spreadsheet with images in cells.

I'm terrible with organizing inventory, so I wanted an easy and simple solution to track my paintings. I also didn't want to spend any money. There are commercial artist inventory programs, like gyst, but that seemed like overkill for my needs. A spreadsheet, like what is available in google docs, seemed perfectly adequate.

I also keep all my images and documents online these days. There are privacy concerns, but after years of losing data and dealing with bad disks, zip drives, and burning CDs, for me it's worth the trade off. So using a web service like Google Docs/Drive made sense for me.

I already take photos of my artwork and store them on Google Drive, and so far I've just manually made a web sized version in Photoshop. But initial tests with this system and google docs showed two problems: 

  1. Once you have dozens of images in a spreadsheet it really bogs down, even at 'web resolution'. I really needed thumbnail images.
  2. Adding an image to a google sheet makes it just 'float' on top, rather than be in a cell. This is annoying.

To solve the first problem I needed to make dozens of thumbnails, which I didn't want to do by hand. This is a perfect task to automate. The short script I ended up making is located here.

I already have all my high res art photos in one directory on Google Drive. Running this script on that directory generates thumbnails and medium sized versions with the suffix "_tn" "_sm". So for a given image I may have:

  • chinatown01.jpg (my high res original, made manually).
  • chinatown01_det01.jpg (an optional detail image, made manually).
  • chinatown01_sm (a web sized image, made by script)
  • chinatown01_tn (a thumbnail, made by script).


That solves the thumbnail problem. Now, to use them in a spreadsheet. 

Here is my google spreadsheet template, feel free to save a copy.  You change the year to get automatic "inventory numbers" on your paintings, and can simply copy and paste a new row when you add a painting. 

Getting the images to be locked into a cell requires the image be hosted online, and the use of the '=IMAGE' formula in the spreadsheet. Fortunately when an image is on Google Drive with "link sharing" enabled that counts.

A Google Drive folder full of images and auto-generated thumbnails

A Google Drive folder full of images and auto-generated thumbnails

To add your image go to Google drive, right click on any of the thumbnail images, and select 'sharable link'. You will get a popup with a long URL. At the end of that URL is a string of letters and numbers, something like "0B08IThSJpP5tc2Z4UmtUjNxYm8". That is the image's "ID". Copy that part and ignore the rest.

Back in the spreadsheet you will see a line I've left in the image tab. It looks like:
=IMAGE("http://drive.google.com/uc?export=view&id=",3)

Paste the image ID after the '=' sign. It should look something like this:
=IMAGE("http://drive.google.com/uc?export=view&id=0B08IThSJpP5tc2Z4UmtUjNxYm8",3)

Your image should appear in the spreadsheet. This also works with any image online if you change the entire URL, not just Google Drive images. So if you use a different cloud storage solution, or you keep your images online, that works as well.

I've found this to be reasonably fast. I was able to add about forty paintings to the spreadsheet in about an hour. When I make a new painting I save it in my image folder, run my script, copy/paste a new row in the spreadsheet, change the image ID, and edit the details.