Aaron Sumner

Sales visualizations for Leanpub authors: January 2013's Project a Month Project

This month's Project a Month Project was a small one, with a very small intended audience: Me. As you may know, I began selling a self-published book last May, via a publishing service called Leanpub. Leanpub offers a CSV of sales data for authors, updated upon every new sale. I wanted to look at this data graphically as opposed to tabularly–and since Rails is my hammer and this problem was a nail, I wrote a dirty little Rails app to create some basic charts of my sales and royalty data.

Standard disclaimer: This is not a Leanpub product! I'm only using the name Leanpub since this application is useless without a Leanpub sales data file. Leanpub is a service of Ruboss Technology Corporation, a corporation incorporated in British Columbia, Canada. I self-publish a book using this service, but am otherwise not affiliated with them in any way.

I run the application locally on my computer, so there was no need to fret about authentication or other security measures. Once data are updated via a basic file upload, then parsed with Ruby's CSV library, the convenient Highcharts Javascript library (via the Lazy Highcharts gem) display data month-over-month. I also break things down day-over-day within a selected month.

The code is ugly with no test suite. The user interface is spartan at best. But I didn't write this to show off any software development prowess. I wrote it because I needed it. I open sourced it in case someone else might need it.

. Questions or comments? Let me know what you think.