Persisting data that is dynamically generated in Python component

The former, following the process outlined here:

I just tried this:

from ghpythonlib.componentbase import executingcomponent as component
import Grasshopper, GhPython
import System
import Rhino
import rhinoscriptsyntax as rs
from Rhino.Geometry import Point3d as p3

class MyComponent(component):

    def RunScript(self, P):
        X = reader.GetString("SomeData");
        return X

    def read(self, P):
        X = reader.GetString("SomeData");
        return X

But I’m getting an error: “solution exception: global name reader is not defined”. Is there a module that I need to import?