Moves - How do I spend a day?
This is a set of scripts to collect data and generate a plot like How Different Groups Spend Their Day by New York Times.
This is not packaged for the general installation. Use just in a working clone directory of this git repository.
My life for last two and half months.
Register your API client on Moves developer site.
dumpmoves.py. This listens on TCP port 9416 by default to receive code from OAuth procedures. Change appropriate firewall settings or the port number when needed.
Open http://your_ip_address:9416/ on a web browser, and authorize the client by following the presented instruction. When the authorization token is received by the script, it will automatically dump all your Moves storylines into
Then, you need to classify places in your storyline into few categories. Generate the list of places:
% python generate-unknown-place-table.py > my-places.csv
Then, fill the category names on the third column with your favorite spread sheet. It is recommended to use category names in short single English word to make the subsequent processing easier.
When you finished filling the categorization table, run
update-place-table.py. It expects CSV input from stdin, puts them into
placecategory.dbin shelve format.
% python update-place-table.py < my-places.csv
Build a numeric matrix representing your daily life with
summarize-activity.py. This uses the storyline database and place categorization database made in earlier steps.
% python summarize-activity.py
There are few hard-coded stuff in the script. Change them as you need. :) This script counts activities in regular week days. The list of holidays is specified in top of the script. Translation of 'moves' activity (walk, run, transport or cycling) to your own category name is done with
activity2categorydictionary on the following few lines after the list of holidays. Timezone is assumed as same to the host running the script. The atomic unit of the statistics is defined as 300 seconds (5 minutes) on the end part of the script.
Plot it finally! First, change the list of activity categories and their colors defined inside
plot-weekdays-life.py. Then, run the script to show the plot, click the save button to save the figure as a file.
% python plot-weekdays-life.py
These scripts use data from Moves but is not endorsed or certified by Moves. Moves is a trademark of ProtoGeo Oy.
Copyright (c) 2013 Hyeshik Chang firstname.lastname@example.org
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.