You can serialise the data using the native pickle module:
And using native json for a more universal solution:
Edit: Assuming Jupyter Notebook can send/host raw textual data to a URL, you can also read that directly (i.e. skipping saving to file). Here’s a quick example demonstrating how to read a JSON file from a URL and casting that to a dictionary: