If you’re looking to implement RhinoCommon (which Grasshopper implements) outside of Rhino in CPython, have a look here: