Infinite Playground Logo

Analog Pixel

An experiment on how to make the things you read more actionable; why read
if you aren't going to get anything out of it?

I have a lot of highlights from books I've read, and I do review them everyday
using readwise.io (the first few times I saw people talking
about readwise I thought they were crazy paying money to be reminded about their
highlights, but now I'm up to a 238 day streak as of writing this.)

But this wasn't good enough, I was looking for a way to make the things I highlight more
actionable, because if the words triggered me enough to highlight them, then there
is probably an idea waiting to be discovered in there.

So initially, the experiment was to just add a note to every highlight explaining to myself
why I found this block of text interesting; what ideas did it spark? And that in itself
is actually a pretty good habit I've gotten into. But then I was thinking of a way to actually
use the highlights even more and came up with this system:

As before, after you highlight some text, leave a note on why, but then add one of these:

T: todo
E: experiment
Q: question
I: idea

So, let's saying I'm reading a book, and highlight some text about making more actionable decisions with
the content you read, i'd then add a note:

I should figure out a way to make my consumption more actionable.

E: a system that allows me to scan through my highlights looking for metadata on experiments I want to do

Great. Now I have all of these notes stored off somewhere; now what?

Readwise also has a very nice, very easy to use api, so I wrote a python script that pulls all my highlights, and then formats out the different sections:

import datetime
import requests  # This may need to be installed from pip
from IPython.display import display, Markdown, Latex

def fetch_from_export_api(updated_after=None):
    full_data = []
    next_page_cursor = None
    while True:
        params = {}
        if next_page_cursor:
            params['pageCursor'] = next_page_cursor
        if updated_after:
            params['updatedAfter'] = updated_after
        print("Making export api request with params " + str(params) + "...")
        response = requests.get(
            url="https://readwise.io/api/v2/export/",
            params=params,
            headers={"Authorization": f"Token {token}"}, verify=False
        )
        full_data.extend(response.json()['results'])
        next_page_cursor = response.json().get('nextPageCursor')
        if not next_page_cursor:
            break
    return full_data

# Get all of a user's books/highlights from all time
all_data = fetch_from_export_api()

tags = {'E:': [], 'Q:': [], 'I:': [], 'T:': [] }
doc =  {'E:': "Experiment", "Q:": "Question", "I:": "Idea", "T:": "Todo"}

for book in all_data:
    for highlight in book['highlights']:
        if highlight['note'] != "":
            for line in highlight['note'].split('\n'):
                for k in tags.keys():
                    if k in line:
                        tags[k].append(line.split(':')[1].strip() + "\n>" + highlight['text'])            

mdout = ""
for d in doc:
    mdout += f"## {doc[d]}\n"
    for item in tags[d]:
        mdout += f"* {item}\n" 
    mdout += "\n\n"


display(Markdown(mdout))

Note make sure you include your token="" for this to work, also, this was made to work in a juptyer notebook.

After running this, you should have a nicely formatted list of all the things you want to take action on.



Home