diff --git a/oura/oura_downloader.ipynb b/oura/oura_downloader.ipynb
index 2e37a2f..87a242a 100644
--- a/oura/oura_downloader.ipynb
+++ b/oura/oura_downloader.ipynb
@@ -94,7 +94,8 @@
"\n",
"* Go to the Developer Section of the Oura Cloud (https://cloud.ouraring.com/oauth/developer).\n",
"* Go to “My Applications” and create a new application by clicking on “New Application”.\n",
- "* Fill out the form fields with your data.\n",
+ "* Fill out the form fields with your data. You need to check `Allow client-side authentication (grant-type token)`\n",
+ " and `Allow server-side authentication (grant-type code)`.\n",
"* Set your callback URL as http://localhost:65010/oura_auth\n",
"* After saving the form, copy your \"Client ID\" and \"Client Secret\" from your Oura application, \n",
"* Inside the directory, copy the file credentials-sample.json and create credentials.json\n",
@@ -151,7 +152,11 @@
"# this script to start server \n",
"# then visit provided url to complete process, generate token and copy\n",
"# Comment out once completed\n",
- "# %run ./oura_server.py"
+ "# %run ./oura_server.py\n",
+ "\n",
+ "# to stop the execution, interrupt the server execution to be\n",
+ "# able to proceed next, press Kernel -> Interrupt (alternatively, \n",
+ "# you can trigger the server in a separate window and not in jupyter)"
]
},
{
@@ -466,7 +471,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.6.2"
+ "version": "3.7.4"
}
},
"nbformat": 4,
diff --git a/oura/oura_server.py b/oura/oura_server.py
index f5218c0..f985203 100755
--- a/oura/oura_server.py
+++ b/oura/oura_server.py
@@ -14,7 +14,6 @@
oura_cr = credentials['oura']
CLIENT_SECRET = oura_cr['CLIENT_SECRET']
CLIENT_ID = oura_cr['CLIENT_ID']
- # ACCESS_TOKEN = oura_cr['ACCESS_TOKEN']
from flask import Flask, abort, request
@@ -26,10 +25,8 @@ def homepage():
def make_authorization_url():
# Generate a random string for the state parameter
- # Save it for use later to prevent xsrf attacks
from uuid import uuid4
state = str(uuid4())
- save_created_state(state)
params = {"client_id": CLIENT_ID,
"response_type": "code",
"state": state,
@@ -60,9 +57,6 @@ def oura_redir():
if error:
return "Error: " + error
state = request.args.get('state', '')
- if not is_valid_state(state):
- # Uh-oh, this request wasn't started by us!
- abort(403)
code = request.args.get('code')
return "got an access token! %s" % get_token(code)
diff --git a/todoist/todoist_data_analysis.ipynb b/todoist/todoist_data_analysis.ipynb
index cbfd813..efbfded 100644
--- a/todoist/todoist_data_analysis.ipynb
+++ b/todoist/todoist_data_analysis.ipynb
@@ -501,11 +501,12 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
- "# Set Year\n",
+ "# Set Year - must have at least some December data for the code below to work\n",
+ "# i.e. it should work fine for years which have already finished\n",
"target_year = 2018"
]
},
@@ -978,7 +979,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.6.2"
+ "version": "3.7.4"
}
},
"nbformat": 4,
diff --git a/todoist/todoist_downloader.ipynb b/todoist/todoist_downloader.ipynb
index 523a0bc..1976ea9 100644
--- a/todoist/todoist_downloader.ipynb
+++ b/todoist/todoist_downloader.ipynb
@@ -35,10 +35,10 @@
"\n",
"#### Signup and Create a Todoist App\n",
"\n",
- "* Signup at https://developer.todoist.com/appconsole.html\n",
- "* Once app is created, generate and copy a \"Test token,\" which provides access to API as your user.\n",
+ "* Go to https://todoist.com/prefs/integrations and find you `API Token`\n",
+ " at the very bottom of the page\n",
"* Copy sample-credentials.json and create credentials.json\n",
- "* Add and Save your Test Token to credentials.json\n"
+ "* Add and Save your `API Token` to credentials.json\n"
]
},
{
@@ -58,9 +58,7 @@
{
"cell_type": "code",
"execution_count": 1,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"from todoist.api import TodoistAPI\n",
@@ -79,9 +77,7 @@
{
"cell_type": "code",
"execution_count": 2,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"import json\n",
@@ -95,9 +91,7 @@
{
"cell_type": "code",
"execution_count": 3,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"api = TodoistAPI(TOKEN)\n",
@@ -121,9 +115,7 @@
{
"cell_type": "code",
"execution_count": 4,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"user = api.state['user']"
@@ -142,63 +134,9 @@
"cell_type": "code",
"execution_count": 6,
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "'Mark Koester'"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "user['full_name']"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "1"
- ]
- },
- "execution_count": 7,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "# Tasks Completed Today\n",
- "user['completed_today']"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "4698"
- ]
- },
- "execution_count": 8,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
- "# total completed tasks\n",
- "user_completed_count = user['completed_count']\n",
- "user_completed_count"
+ "# user['full_name']"
]
},
{
@@ -228,10 +166,8 @@
},
{
"cell_type": "code",
- "execution_count": 9,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 7,
+ "metadata": {},
"outputs": [],
"source": [
"user_projects = api.state['projects']"
@@ -239,10 +175,8 @@
},
{
"cell_type": "code",
- "execution_count": 10,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 8,
+ "metadata": {},
"outputs": [],
"source": [
"# user_projects"
@@ -250,16 +184,16 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "41"
+ "24"
]
},
- "execution_count": 11,
+ "execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
@@ -270,10 +204,8 @@
},
{
"cell_type": "code",
- "execution_count": 12,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 10,
+ "metadata": {},
"outputs": [],
"source": [
"with open('data/todoist-projects.csv', 'w') as file:\n",
@@ -284,10 +216,8 @@
},
{
"cell_type": "code",
- "execution_count": 13,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 11,
+ "metadata": {},
"outputs": [],
"source": [
"projects = pd.read_csv(\"data/todoist-projects.csv\")"
@@ -295,10 +225,8 @@
},
{
"cell_type": "code",
- "execution_count": 14,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 12,
+ "metadata": {},
"outputs": [],
"source": [
"# projects"
@@ -327,10 +255,8 @@
},
{
"cell_type": "code",
- "execution_count": 15,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 13,
+ "metadata": {},
"outputs": [],
"source": [
"stats = api.completed.get_stats()"
@@ -338,16 +264,16 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "4988"
+ "5311"
]
},
- "execution_count": 16,
+ "execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@@ -383,10 +309,8 @@
},
{
"cell_type": "code",
- "execution_count": 17,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 15,
+ "metadata": {},
"outputs": [],
"source": [
"def get_completed_todoist_items():\n",
@@ -399,7 +323,7 @@
" for count, item in enumerate(pager):\n",
" tmp_tasks = (api.completed.get_all(limit=50, offset=item))\n",
" tmp_tasks_df = pd.DataFrame.from_dict(tmp_tasks['items'])\n",
- " past_tasks = pd.concat([past_tasks, tmp_tasks_df])\n",
+ " past_tasks = pd.concat([past_tasks, tmp_tasks_df], sort=False)\n",
" print(\"Collecting Additional Todoist Tasks \" + str(item) + \" of \" + str(user_completed_stats))\n",
" # save to CSV\n",
" print(\"...Generating CSV Export\")\n",
@@ -408,113 +332,122 @@
},
{
"cell_type": "code",
- "execution_count": 18,
- "metadata": {},
+ "execution_count": 16,
+ "metadata": {
+ "scrolled": true
+ },
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting Initial 50 Completed Todoist Tasks...\n",
- "Collecting Additional Todoist Tasks 50 of 4988\n",
- "Collecting Additional Todoist Tasks 100 of 4988\n",
- "Collecting Additional Todoist Tasks 150 of 4988\n",
- "Collecting Additional Todoist Tasks 200 of 4988\n",
- "Collecting Additional Todoist Tasks 250 of 4988\n",
- "Collecting Additional Todoist Tasks 300 of 4988\n",
- "Collecting Additional Todoist Tasks 350 of 4988\n",
- "Collecting Additional Todoist Tasks 400 of 4988\n",
- "Collecting Additional Todoist Tasks 450 of 4988\n",
- "Collecting Additional Todoist Tasks 500 of 4988\n",
- "Collecting Additional Todoist Tasks 550 of 4988\n",
- "Collecting Additional Todoist Tasks 600 of 4988\n",
- "Collecting Additional Todoist Tasks 650 of 4988\n",
- "Collecting Additional Todoist Tasks 700 of 4988\n",
- "Collecting Additional Todoist Tasks 750 of 4988\n",
- "Collecting Additional Todoist Tasks 800 of 4988\n",
- "Collecting Additional Todoist Tasks 850 of 4988\n",
- "Collecting Additional Todoist Tasks 900 of 4988\n",
- "Collecting Additional Todoist Tasks 950 of 4988\n",
- "Collecting Additional Todoist Tasks 1000 of 4988\n",
- "Collecting Additional Todoist Tasks 1050 of 4988\n",
- "Collecting Additional Todoist Tasks 1100 of 4988\n",
- "Collecting Additional Todoist Tasks 1150 of 4988\n",
- "Collecting Additional Todoist Tasks 1200 of 4988\n",
- "Collecting Additional Todoist Tasks 1250 of 4988\n",
- "Collecting Additional Todoist Tasks 1300 of 4988\n",
- "Collecting Additional Todoist Tasks 1350 of 4988\n",
- "Collecting Additional Todoist Tasks 1400 of 4988\n",
- "Collecting Additional Todoist Tasks 1450 of 4988\n",
- "Collecting Additional Todoist Tasks 1500 of 4988\n",
- "Collecting Additional Todoist Tasks 1550 of 4988\n",
- "Collecting Additional Todoist Tasks 1600 of 4988\n",
- "Collecting Additional Todoist Tasks 1650 of 4988\n",
- "Collecting Additional Todoist Tasks 1700 of 4988\n",
- "Collecting Additional Todoist Tasks 1750 of 4988\n",
- "Collecting Additional Todoist Tasks 1800 of 4988\n",
- "Collecting Additional Todoist Tasks 1850 of 4988\n",
- "Collecting Additional Todoist Tasks 1900 of 4988\n",
- "Collecting Additional Todoist Tasks 1950 of 4988\n",
- "Collecting Additional Todoist Tasks 2000 of 4988\n",
- "Collecting Additional Todoist Tasks 2050 of 4988\n",
- "Collecting Additional Todoist Tasks 2100 of 4988\n",
- "Collecting Additional Todoist Tasks 2150 of 4988\n",
- "Collecting Additional Todoist Tasks 2200 of 4988\n",
- "Collecting Additional Todoist Tasks 2250 of 4988\n",
- "Collecting Additional Todoist Tasks 2300 of 4988\n",
- "Collecting Additional Todoist Tasks 2350 of 4988\n",
- "Collecting Additional Todoist Tasks 2400 of 4988\n",
- "Collecting Additional Todoist Tasks 2450 of 4988\n",
- "Collecting Additional Todoist Tasks 2500 of 4988\n",
- "Collecting Additional Todoist Tasks 2550 of 4988\n",
- "Collecting Additional Todoist Tasks 2600 of 4988\n",
- "Collecting Additional Todoist Tasks 2650 of 4988\n",
- "Collecting Additional Todoist Tasks 2700 of 4988\n",
- "Collecting Additional Todoist Tasks 2750 of 4988\n",
- "Collecting Additional Todoist Tasks 2800 of 4988\n",
- "Collecting Additional Todoist Tasks 2850 of 4988\n",
- "Collecting Additional Todoist Tasks 2900 of 4988\n",
- "Collecting Additional Todoist Tasks 2950 of 4988\n",
- "Collecting Additional Todoist Tasks 3000 of 4988\n",
- "Collecting Additional Todoist Tasks 3050 of 4988\n",
- "Collecting Additional Todoist Tasks 3100 of 4988\n",
- "Collecting Additional Todoist Tasks 3150 of 4988\n",
- "Collecting Additional Todoist Tasks 3200 of 4988\n",
- "Collecting Additional Todoist Tasks 3250 of 4988\n",
- "Collecting Additional Todoist Tasks 3300 of 4988\n",
- "Collecting Additional Todoist Tasks 3350 of 4988\n",
- "Collecting Additional Todoist Tasks 3400 of 4988\n",
- "Collecting Additional Todoist Tasks 3450 of 4988\n",
- "Collecting Additional Todoist Tasks 3500 of 4988\n",
- "Collecting Additional Todoist Tasks 3550 of 4988\n",
- "Collecting Additional Todoist Tasks 3600 of 4988\n",
- "Collecting Additional Todoist Tasks 3650 of 4988\n",
- "Collecting Additional Todoist Tasks 3700 of 4988\n",
- "Collecting Additional Todoist Tasks 3750 of 4988\n",
- "Collecting Additional Todoist Tasks 3800 of 4988\n",
- "Collecting Additional Todoist Tasks 3850 of 4988\n",
- "Collecting Additional Todoist Tasks 3900 of 4988\n",
- "Collecting Additional Todoist Tasks 3950 of 4988\n",
- "Collecting Additional Todoist Tasks 4000 of 4988\n",
- "Collecting Additional Todoist Tasks 4050 of 4988\n",
- "Collecting Additional Todoist Tasks 4100 of 4988\n",
- "Collecting Additional Todoist Tasks 4150 of 4988\n",
- "Collecting Additional Todoist Tasks 4200 of 4988\n",
- "Collecting Additional Todoist Tasks 4250 of 4988\n",
- "Collecting Additional Todoist Tasks 4300 of 4988\n",
- "Collecting Additional Todoist Tasks 4350 of 4988\n",
- "Collecting Additional Todoist Tasks 4400 of 4988\n",
- "Collecting Additional Todoist Tasks 4450 of 4988\n",
- "Collecting Additional Todoist Tasks 4500 of 4988\n",
- "Collecting Additional Todoist Tasks 4550 of 4988\n",
- "Collecting Additional Todoist Tasks 4600 of 4988\n",
- "Collecting Additional Todoist Tasks 4650 of 4988\n",
- "Collecting Additional Todoist Tasks 4700 of 4988\n",
- "Collecting Additional Todoist Tasks 4750 of 4988\n",
- "Collecting Additional Todoist Tasks 4800 of 4988\n",
- "Collecting Additional Todoist Tasks 4850 of 4988\n",
- "Collecting Additional Todoist Tasks 4900 of 4988\n",
- "Collecting Additional Todoist Tasks 4950 of 4988\n",
+ "Collecting Additional Todoist Tasks 50 of 5311\n",
+ "Collecting Additional Todoist Tasks 100 of 5311\n",
+ "Collecting Additional Todoist Tasks 150 of 5311\n",
+ "Collecting Additional Todoist Tasks 200 of 5311\n",
+ "Collecting Additional Todoist Tasks 250 of 5311\n",
+ "Collecting Additional Todoist Tasks 300 of 5311\n",
+ "Collecting Additional Todoist Tasks 350 of 5311\n",
+ "Collecting Additional Todoist Tasks 400 of 5311\n",
+ "Collecting Additional Todoist Tasks 450 of 5311\n",
+ "Collecting Additional Todoist Tasks 500 of 5311\n",
+ "Collecting Additional Todoist Tasks 550 of 5311\n",
+ "Collecting Additional Todoist Tasks 600 of 5311\n",
+ "Collecting Additional Todoist Tasks 650 of 5311\n",
+ "Collecting Additional Todoist Tasks 700 of 5311\n",
+ "Collecting Additional Todoist Tasks 750 of 5311\n",
+ "Collecting Additional Todoist Tasks 800 of 5311\n",
+ "Collecting Additional Todoist Tasks 850 of 5311\n",
+ "Collecting Additional Todoist Tasks 900 of 5311\n",
+ "Collecting Additional Todoist Tasks 950 of 5311\n",
+ "Collecting Additional Todoist Tasks 1000 of 5311\n",
+ "Collecting Additional Todoist Tasks 1050 of 5311\n",
+ "Collecting Additional Todoist Tasks 1100 of 5311\n",
+ "Collecting Additional Todoist Tasks 1150 of 5311\n",
+ "Collecting Additional Todoist Tasks 1200 of 5311\n",
+ "Collecting Additional Todoist Tasks 1250 of 5311\n",
+ "Collecting Additional Todoist Tasks 1300 of 5311\n",
+ "Collecting Additional Todoist Tasks 1350 of 5311\n",
+ "Collecting Additional Todoist Tasks 1400 of 5311\n",
+ "Collecting Additional Todoist Tasks 1450 of 5311\n",
+ "Collecting Additional Todoist Tasks 1500 of 5311\n",
+ "Collecting Additional Todoist Tasks 1550 of 5311\n",
+ "Collecting Additional Todoist Tasks 1600 of 5311\n",
+ "Collecting Additional Todoist Tasks 1650 of 5311\n",
+ "Collecting Additional Todoist Tasks 1700 of 5311\n",
+ "Collecting Additional Todoist Tasks 1750 of 5311\n",
+ "Collecting Additional Todoist Tasks 1800 of 5311\n",
+ "Collecting Additional Todoist Tasks 1850 of 5311\n",
+ "Collecting Additional Todoist Tasks 1900 of 5311\n",
+ "Collecting Additional Todoist Tasks 1950 of 5311\n",
+ "Collecting Additional Todoist Tasks 2000 of 5311\n",
+ "Collecting Additional Todoist Tasks 2050 of 5311\n",
+ "Collecting Additional Todoist Tasks 2100 of 5311\n",
+ "Collecting Additional Todoist Tasks 2150 of 5311\n",
+ "Collecting Additional Todoist Tasks 2200 of 5311\n",
+ "Collecting Additional Todoist Tasks 2250 of 5311\n",
+ "Collecting Additional Todoist Tasks 2300 of 5311\n",
+ "Collecting Additional Todoist Tasks 2350 of 5311\n",
+ "Collecting Additional Todoist Tasks 2400 of 5311\n",
+ "Collecting Additional Todoist Tasks 2450 of 5311\n",
+ "Collecting Additional Todoist Tasks 2500 of 5311\n",
+ "Collecting Additional Todoist Tasks 2550 of 5311\n",
+ "Collecting Additional Todoist Tasks 2600 of 5311\n",
+ "Collecting Additional Todoist Tasks 2650 of 5311\n",
+ "Collecting Additional Todoist Tasks 2700 of 5311\n",
+ "Collecting Additional Todoist Tasks 2750 of 5311\n",
+ "Collecting Additional Todoist Tasks 2800 of 5311\n",
+ "Collecting Additional Todoist Tasks 2850 of 5311\n",
+ "Collecting Additional Todoist Tasks 2900 of 5311\n",
+ "Collecting Additional Todoist Tasks 2950 of 5311\n",
+ "Collecting Additional Todoist Tasks 3000 of 5311\n",
+ "Collecting Additional Todoist Tasks 3050 of 5311\n",
+ "Collecting Additional Todoist Tasks 3100 of 5311\n",
+ "Collecting Additional Todoist Tasks 3150 of 5311\n",
+ "Collecting Additional Todoist Tasks 3200 of 5311\n",
+ "Collecting Additional Todoist Tasks 3250 of 5311\n",
+ "Collecting Additional Todoist Tasks 3300 of 5311\n",
+ "Collecting Additional Todoist Tasks 3350 of 5311\n",
+ "Collecting Additional Todoist Tasks 3400 of 5311\n",
+ "Collecting Additional Todoist Tasks 3450 of 5311\n",
+ "Collecting Additional Todoist Tasks 3500 of 5311\n",
+ "Collecting Additional Todoist Tasks 3550 of 5311\n",
+ "Collecting Additional Todoist Tasks 3600 of 5311\n",
+ "Collecting Additional Todoist Tasks 3650 of 5311\n",
+ "Collecting Additional Todoist Tasks 3700 of 5311\n",
+ "Collecting Additional Todoist Tasks 3750 of 5311\n",
+ "Collecting Additional Todoist Tasks 3800 of 5311\n",
+ "Collecting Additional Todoist Tasks 3850 of 5311\n",
+ "Collecting Additional Todoist Tasks 3900 of 5311\n",
+ "Collecting Additional Todoist Tasks 3950 of 5311\n",
+ "Collecting Additional Todoist Tasks 4000 of 5311\n",
+ "Collecting Additional Todoist Tasks 4050 of 5311\n",
+ "Collecting Additional Todoist Tasks 4100 of 5311\n",
+ "Collecting Additional Todoist Tasks 4150 of 5311\n",
+ "Collecting Additional Todoist Tasks 4200 of 5311\n",
+ "Collecting Additional Todoist Tasks 4250 of 5311\n",
+ "Collecting Additional Todoist Tasks 4300 of 5311\n",
+ "Collecting Additional Todoist Tasks 4350 of 5311\n",
+ "Collecting Additional Todoist Tasks 4400 of 5311\n",
+ "Collecting Additional Todoist Tasks 4450 of 5311\n",
+ "Collecting Additional Todoist Tasks 4500 of 5311\n",
+ "Collecting Additional Todoist Tasks 4550 of 5311\n",
+ "Collecting Additional Todoist Tasks 4600 of 5311\n",
+ "Collecting Additional Todoist Tasks 4650 of 5311\n",
+ "Collecting Additional Todoist Tasks 4700 of 5311\n",
+ "Collecting Additional Todoist Tasks 4750 of 5311\n",
+ "Collecting Additional Todoist Tasks 4800 of 5311\n",
+ "Collecting Additional Todoist Tasks 4850 of 5311\n",
+ "Collecting Additional Todoist Tasks 4900 of 5311\n",
+ "Collecting Additional Todoist Tasks 4950 of 5311\n",
+ "Collecting Additional Todoist Tasks 5000 of 5311\n",
+ "Collecting Additional Todoist Tasks 5050 of 5311\n",
+ "Collecting Additional Todoist Tasks 5100 of 5311\n",
+ "Collecting Additional Todoist Tasks 5150 of 5311\n",
+ "Collecting Additional Todoist Tasks 5200 of 5311\n",
+ "Collecting Additional Todoist Tasks 5250 of 5311\n",
+ "Collecting Additional Todoist Tasks 5300 of 5311\n",
"...Generating CSV Export\n"
]
}
@@ -525,10 +458,8 @@
},
{
"cell_type": "code",
- "execution_count": 19,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 17,
+ "metadata": {},
"outputs": [],
"source": [
"past_tasks = pd.read_csv(\"data/todost-raw-tasks-completed.csv\")"
@@ -536,138 +467,25 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 18,
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " completed_date | \n",
- " content | \n",
- " id | \n",
- " meta_data | \n",
- " project_id | \n",
- " task_id | \n",
- " user_id | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " 0 | \n",
- " Thu 06 Dec 2018 10:19:02 +0000 | \n",
- " READINGS: Running Stride and Cadence | \n",
- " 2890761399 | \n",
- " NaN | \n",
- " 2158267779 | \n",
- " 2890761399 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 1 | \n",
- " Thu 06 Dec 2018 10:19:02 +0000 | \n",
- " Readings and Review on Running Stride | \n",
- " 2890761573 | \n",
- " NaN | \n",
- " 2158267779 | \n",
- " 2890761573 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 2 | \n",
- " Thu 06 Dec 2018 10:18:59 +0000 | \n",
- " READ / Notes on Are Emotions of Natural Kind? | \n",
- " 2939017612 | \n",
- " NaN | \n",
- " 178797715 | \n",
- " 2939017612 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 3 | \n",
- " Thu 06 Dec 2018 10:18:57 +0000 | \n",
- " Debug Site Down for GayRomLit | \n",
- " 2939016120 | \n",
- " NaN | \n",
- " 179268527 | \n",
- " 2939016120 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 4 | \n",
- " Wed 05 Dec 2018 16:45:33 +0000 | \n",
- " Call with Jo Carol | \n",
- " 2937620714 | \n",
- " NaN | \n",
- " 2182684133 | \n",
- " 2937620714 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " completed_date \\\n",
- "0 Thu 06 Dec 2018 10:19:02 +0000 \n",
- "1 Thu 06 Dec 2018 10:19:02 +0000 \n",
- "2 Thu 06 Dec 2018 10:18:59 +0000 \n",
- "3 Thu 06 Dec 2018 10:18:57 +0000 \n",
- "4 Wed 05 Dec 2018 16:45:33 +0000 \n",
- "\n",
- " content id meta_data \\\n",
- "0 READINGS: Running Stride and Cadence 2890761399 NaN \n",
- "1 Readings and Review on Running Stride 2890761573 NaN \n",
- "2 READ / Notes on Are Emotions of Natural Kind? 2939017612 NaN \n",
- "3 Debug Site Down for GayRomLit 2939016120 NaN \n",
- "4 Call with Jo Carol 2937620714 NaN \n",
- "\n",
- " project_id task_id user_id \n",
- "0 2158267779 2890761399 4288657 \n",
- "1 2158267779 2890761573 4288657 \n",
- "2 178797715 2939017612 4288657 \n",
- "3 179268527 2939016120 4288657 \n",
- "4 2182684133 2937620714 4288657 "
- ]
- },
- "execution_count": 20,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
- "past_tasks.head()"
+ "# past_tasks.head()"
]
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "4988"
+ "5342"
]
},
- "execution_count": 21,
+ "execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
@@ -680,37 +498,16 @@
},
{
"cell_type": "code",
- "execution_count": 22,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "False"
- ]
- },
- "execution_count": 22,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "# Does our collected total tasks match stat of completed count on user\n",
- "collected_total == user_completed_count"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 23,
+ "execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "4988"
+ "5342"
]
},
- "execution_count": 23,
+ "execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
@@ -721,10 +518,8 @@
},
{
"cell_type": "code",
- "execution_count": 24,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 21,
+ "metadata": {},
"outputs": [],
"source": [
"past_tasks['project_id'] = past_tasks.project_id.astype('category')"
@@ -732,7 +527,7 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 22,
"metadata": {},
"outputs": [
{
@@ -740,17 +535,20 @@
"output_type": "stream",
"text": [
"\n",
- "RangeIndex: 4988 entries, 0 to 4987\n",
- "Data columns (total 7 columns):\n",
- "completed_date 4988 non-null object\n",
- "content 4988 non-null object\n",
- "id 4988 non-null int64\n",
- "meta_data 0 non-null float64\n",
- "project_id 4988 non-null category\n",
- "task_id 4988 non-null int64\n",
- "user_id 4988 non-null int64\n",
- "dtypes: category(1), float64(1), int64(3), object(2)\n",
- "memory usage: 240.3+ KB\n"
+ "RangeIndex: 5342 entries, 0 to 5341\n",
+ "Data columns (total 10 columns):\n",
+ "content 5340 non-null object\n",
+ "meta_data 0 non-null float64\n",
+ "user_id 5342 non-null int64\n",
+ "task_id 5342 non-null int64\n",
+ "project_id 5342 non-null category\n",
+ "completed_date 5342 non-null object\n",
+ "id 5342 non-null int64\n",
+ "legacy_project_id 5032 non-null float64\n",
+ "legacy_task_id 1904 non-null float64\n",
+ "legacy_id 1728 non-null float64\n",
+ "dtypes: category(1), float64(4), int64(3), object(2)\n",
+ "memory usage: 382.6+ KB\n"
]
}
],
@@ -760,16 +558,16 @@
},
{
"cell_type": "code",
- "execution_count": 26,
+ "execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "43"
+ "45"
]
},
- "execution_count": 26,
+ "execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
@@ -794,10 +592,8 @@
},
{
"cell_type": "code",
- "execution_count": 27,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 24,
+ "metadata": {},
"outputs": [],
"source": [
"# Extract all project ids used on tasks\n",
@@ -807,16 +603,16 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "43"
+ "45"
]
},
- "execution_count": 28,
+ "execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
@@ -828,10 +624,8 @@
},
{
"cell_type": "code",
- "execution_count": 29,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 26,
+ "metadata": {},
"outputs": [],
"source": [
"# get project info from Todoist API\n",
@@ -846,7 +640,7 @@
},
{
"cell_type": "code",
- "execution_count": 30,
+ "execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
@@ -856,7 +650,7 @@
},
{
"cell_type": "code",
- "execution_count": 31,
+ "execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
@@ -866,10 +660,8 @@
},
{
"cell_type": "code",
- "execution_count": 32,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 29,
+ "metadata": {},
"outputs": [],
"source": [
"# Get Info on All User Projects\n",
@@ -880,66 +672,13 @@
},
{
"cell_type": "code",
- "execution_count": 33,
+ "execution_count": 30,
"metadata": {
- "collapsed": true
+ "scrolled": true
},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "['Exercise',\n",
- " 'Studies: General',\n",
- " 'Misc Client Work',\n",
- " 'BookLoversCon',\n",
- " 'Health',\n",
- " 'Int3 Biz Dev',\n",
- " 'Writing',\n",
- " 'Data-Driven You',\n",
- " 'Tech / Computer',\n",
- " 'Code Studies',\n",
- " 'Productivity, Self-Tracking',\n",
- " 'Podcast Tracker',\n",
- " 'Financial / Investment',\n",
- " 'Maintenance, Org, Cleaning',\n",
- " 'Language Learning',\n",
- " 'Networking / Career',\n",
- " 'Goals',\n",
- " 'Traveling',\n",
- " 'Data',\n",
- " 'Math',\n",
- " 'Int3c Biz, Drupal Dev',\n",
- " 'Design',\n",
- " 'PhotoStats',\n",
- " 'Video',\n",
- " 'RTConvention',\n",
- " 'Nutrition & Food',\n",
- " 'RTBookReviews',\n",
- " 'Drupal Studies & Dev',\n",
- " 'Biomarker Tracker',\n",
- " 'Entrepreneurship / Biz',\n",
- " 'Creative',\n",
- " 'Side Projects / Startups',\n",
- " 'Philosophy',\n",
- " None,\n",
- " 'Maker Building & Studies',\n",
- " 'Exercise, Health, Fitness Related',\n",
- " 'TMW/Nissan',\n",
- " 'Personal',\n",
- " None,\n",
- " 'Poetry',\n",
- " 'Inbox',\n",
- " None,\n",
- " 'RT']"
- ]
- },
- "execution_count": 33,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
- "project_names"
+ "# project_names"
]
},
{
@@ -958,125 +697,17 @@
},
{
"cell_type": "code",
- "execution_count": 34,
+ "execution_count": 31,
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " completed_date | \n",
- " content | \n",
- " id | \n",
- " meta_data | \n",
- " project_id | \n",
- " task_id | \n",
- " user_id | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " 4983 | \n",
- " Sun 28 Aug 2016 12:07:13 +0000 | \n",
- " Read Checklist from MASTER THE GAME | \n",
- " 53281331 | \n",
- " NaN | \n",
- " 178797715 | \n",
- " 53281331 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 4984 | \n",
- " Sun 28 Aug 2016 10:40:51 +0000 | \n",
- " Weekly Review | \n",
- " 53277061 | \n",
- " NaN | \n",
- " 142200795 | \n",
- " 53277061 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 4985 | \n",
- " Sun 28 Aug 2016 10:24:01 +0000 | \n",
- " Financial Reflection Writing | \n",
- " 53275224 | \n",
- " NaN | \n",
- " 142200795 | \n",
- " 53275224 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 4986 | \n",
- " Sun 28 Aug 2016 10:17:51 +0000 | \n",
- " Study Todoist Shortcuts | \n",
- " 53273289 | \n",
- " NaN | \n",
- " 142200795 | \n",
- " 53273289 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- " 4987 | \n",
- " Sun 28 Aug 2016 06:39:21 +0000 | \n",
- " Review & Setup Tasks on TODOIST | \n",
- " 53265021 | \n",
- " NaN | \n",
- " 142200795 | \n",
- " 53265021 | \n",
- " 4288657 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " completed_date content \\\n",
- "4983 Sun 28 Aug 2016 12:07:13 +0000 Read Checklist from MASTER THE GAME \n",
- "4984 Sun 28 Aug 2016 10:40:51 +0000 Weekly Review \n",
- "4985 Sun 28 Aug 2016 10:24:01 +0000 Financial Reflection Writing \n",
- "4986 Sun 28 Aug 2016 10:17:51 +0000 Study Todoist Shortcuts \n",
- "4987 Sun 28 Aug 2016 06:39:21 +0000 Review & Setup Tasks on TODOIST \n",
- "\n",
- " id meta_data project_id task_id user_id \n",
- "4983 53281331 NaN 178797715 53281331 4288657 \n",
- "4984 53277061 NaN 142200795 53277061 4288657 \n",
- "4985 53275224 NaN 142200795 53275224 4288657 \n",
- "4986 53273289 NaN 142200795 53273289 4288657 \n",
- "4987 53265021 NaN 142200795 53265021 4288657 "
- ]
- },
- "execution_count": 34,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
- "past_tasks.tail()"
+ "# past_tasks.tail()"
]
},
{
"cell_type": "code",
- "execution_count": 35,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 32,
+ "metadata": {},
"outputs": [],
"source": [
"# Probably a more effecient way to do this\n",
@@ -1085,10 +716,8 @@
},
{
"cell_type": "code",
- "execution_count": 36,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 33,
+ "metadata": {},
"outputs": [],
"source": [
"past_tasks['project_name'] = past_tasks['project_id'].apply(project_lookup) # note: not very efficient"
@@ -1096,16 +725,16 @@
},
{
"cell_type": "code",
- "execution_count": 37,
+ "execution_count": 34,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "41"
+ "36"
]
},
- "execution_count": 37,
+ "execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
@@ -1116,7 +745,7 @@
},
{
"cell_type": "code",
- "execution_count": 38,
+ "execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
@@ -1132,7 +761,7 @@
},
{
"cell_type": "code",
- "execution_count": 39,
+ "execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
@@ -1149,168 +778,17 @@
},
{
"cell_type": "code",
- "execution_count": 40,
+ "execution_count": 37,
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " content | \n",
- " id | \n",
- " meta_data | \n",
- " project_id | \n",
- " task_id | \n",
- " user_id | \n",
- " project_name | \n",
- " year | \n",
- " month | \n",
- " date | \n",
- " day | \n",
- " hour | \n",
- " dow | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " 0 | \n",
- " READINGS: Running Stride and Cadence | \n",
- " 2890761399 | \n",
- " NaN | \n",
- " 2158267779 | \n",
- " 2890761399 | \n",
- " 4288657 | \n",
- " Exercise | \n",
- " 2018 | \n",
- " 2018-12 | \n",
- " 2018-12-06 | \n",
- " 6 | \n",
- " 18 | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " 1 | \n",
- " Readings and Review on Running Stride | \n",
- " 2890761573 | \n",
- " NaN | \n",
- " 2158267779 | \n",
- " 2890761573 | \n",
- " 4288657 | \n",
- " Exercise | \n",
- " 2018 | \n",
- " 2018-12 | \n",
- " 2018-12-06 | \n",
- " 6 | \n",
- " 18 | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " 2 | \n",
- " READ / Notes on Are Emotions of Natural Kind? | \n",
- " 2939017612 | \n",
- " NaN | \n",
- " 178797715 | \n",
- " 2939017612 | \n",
- " 4288657 | \n",
- " Studies: General | \n",
- " 2018 | \n",
- " 2018-12 | \n",
- " 2018-12-06 | \n",
- " 6 | \n",
- " 18 | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " 3 | \n",
- " Debug Site Down for GayRomLit | \n",
- " 2939016120 | \n",
- " NaN | \n",
- " 179268527 | \n",
- " 2939016120 | \n",
- " 4288657 | \n",
- " Misc Client Work | \n",
- " 2018 | \n",
- " 2018-12 | \n",
- " 2018-12-06 | \n",
- " 6 | \n",
- " 18 | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " 4 | \n",
- " Call with Jo Carol | \n",
- " 2937620714 | \n",
- " NaN | \n",
- " 2182684133 | \n",
- " 2937620714 | \n",
- " 4288657 | \n",
- " BookLoversCon | \n",
- " 2018 | \n",
- " 2018-12 | \n",
- " 2018-12-06 | \n",
- " 6 | \n",
- " 0 | \n",
- " 3 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " content id meta_data \\\n",
- "0 READINGS: Running Stride and Cadence 2890761399 NaN \n",
- "1 Readings and Review on Running Stride 2890761573 NaN \n",
- "2 READ / Notes on Are Emotions of Natural Kind? 2939017612 NaN \n",
- "3 Debug Site Down for GayRomLit 2939016120 NaN \n",
- "4 Call with Jo Carol 2937620714 NaN \n",
- "\n",
- " project_id task_id user_id project_name year month \\\n",
- "0 2158267779 2890761399 4288657 Exercise 2018 2018-12 \n",
- "1 2158267779 2890761573 4288657 Exercise 2018 2018-12 \n",
- "2 178797715 2939017612 4288657 Studies: General 2018 2018-12 \n",
- "3 179268527 2939016120 4288657 Misc Client Work 2018 2018-12 \n",
- "4 2182684133 2937620714 4288657 BookLoversCon 2018 2018-12 \n",
- "\n",
- " date day hour dow \n",
- "0 2018-12-06 6 18 3 \n",
- "1 2018-12-06 6 18 3 \n",
- "2 2018-12-06 6 18 3 \n",
- "3 2018-12-06 6 18 3 \n",
- "4 2018-12-06 6 0 3 "
- ]
- },
- "execution_count": 40,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
- "past_tasks.head()"
+ "# past_tasks.head()"
]
},
{
"cell_type": "code",
- "execution_count": 41,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 38,
+ "metadata": {},
"outputs": [],
"source": [
"# save to CSV\n",
@@ -1327,9 +805,9 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "todoist",
"language": "python",
- "name": "python3"
+ "name": "todoist"
},
"language_info": {
"codemirror_mode": {
@@ -1341,7 +819,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.6.2"
+ "version": "3.7.4"
}
},
"nbformat": 4,