I’m always looking at ways to make my life easier with code.
Sometimes, it’s through automating a process for myself. Other times, it’s about presenting information that informs my decisions.
This project- a word-counter/visualizer, is a bit of both.
The manuscript writing software I use (Scrivener) is an excellent tool, but the windows edition lacked certain features regarding tracking wordcounts over time.
NanoWriMo, a writing event I had previously participated in, has a wonderful bar graph to track your word-count from day to day.
I wanted a similar tool for my own writing- outside of just November, and outside of just NanoWriMo.
Thus, I wanted my own wordcounter.
Scrivener works by having all of your projects contained in a file-tree environment- where individual files can be grouped into folders, and those folders ultimately into the manuscript at large.
They give you the raw numbers for an individual document, but I wanted to see my progress on a day-by-day basis, so I can track how much I am writing over a course of days, weeks, and months.
There are already existent tools which graph wordcounts- but none that seemed to word between multiple files. Rather than tallying how much word I had done across several documents, I wanted a tool which automatically interprets my wordcount for me, rather than adding it up every time I wanted to record my daily wordcount.
Fortunately, scrivener has a feature that allows you to ‘sync’ your project and back it up as text files. As so:
The python tools:
I made three python files for this project, each involved with a separate step.
Wordcounter.py reads the contents of your sync folder, counts the number of words, then stores it to a csv file- along with the date.
This gives me a solid set of records of my wordcount per day (if I run it each day).
As for visualizing the records, Wordgrapher.py takes care of this.
Wordgrapher.py simply reads the contents of the CSV, then creates a bar graph visualizing that wordcount.
I can now tell what my wordcounts were for each day.
There are tons of features & design choices that I will likely add to this tool later. Like my DJ tool, this was mostly designed with my workflow in mind, though may be of use to others.
Now that I have a tool to chart my progress, I just need to keep on writing!