Lol. It is funny how simple the solution is. I wanted it for PTM, but I've been looking for solution through the lens of GPM, because that what I was struggling with for the past couple years. Thanks.
The whole PTM thing is going to open up a lot of possibilities. e.g. combining PTM with template search, you can use data from one library (authors library), to search for books in another. Which brings up the question, now that this is not implemented as a method, how can I persist the data, say for the duration of template search.
Edit: The context object or the globals dict can be used for this.