How do I use an asyncio context manager with Jupyter notebooks to create new tasks?
I have a class called Series, which inherits from a base class called Fred. Series has a number of methods, which retrieve data from different API end points and process that data into properties of the object. The base class Fred simply contains a method for retrieving an API key, and methods to format requests and submit them to the server. I have written all of the relevant “get” methods using asyncio in order to improve the data retrieval time, and if used in a python script or at the iPython console this works fine. However, I would like this code to be useful in a Jupyter notebook as well. The issue I am having is that while I can add the task to the existing Jupyter notebook event loop, somewhere in the middle of executing tasks, the async tasks never seem to property return data.