How to Share Python 3 GhPython Components as Open-Source Plugins or Ghpy?

Hello everyone,

I’m currently developing a Grasshopper plugin using Python component, and I’d like to keep the GhPython component open so users can access and learn from the code. Sharing as a .ghpy works for Python 2.7, but I would like to share my Python 3 script as a .ghpy file as well.

I know there is a script compiler command, but I would prefer not to compile the script in a way that hides the code, as my intention is to keep it open, editable, and also preserve the ability to print output directly in Grasshopper. Currently, I ask users to manually copy the code, but this is time-consuming.

Is there a method to distribute a Python 3 script as an open GhPython component, similar to plugins, without hiding the code or losing output functionality?

Thank you for your help!

Hi @Jacob_isac ,

One step better than manually copying the code… save it as a user object.

This will save the script in whatever “state” you left it in as far as having the inputs/outputs etc. set up and contain the code inside.

Additionally this method will let you set the icon, name, nickname, and description

The source code will be available inside by double clicking into said User Object

1 Like

Exactly what I needed. Thank you so much for the help!

1 Like

You’re welcome!

1 Like