GhHops Server

raw JSON →
1.5.5 verified Sat May 09 auth: no python

A Python server for Grasshopper Hops, enabling remote execution of Grasshopper definitions via HTTP. Version 1.5.5 is the current stable release; updates are tied to the compute.rhino3d ecosystem and are infrequent.

pip install ghhops-server
error ModuleNotFoundError: No module named 'ghhops_server'
cause The package is not installed or is installed under a different name (e.g., 'ghhops').
fix
Run 'pip install ghhops-server' and ensure you import as 'ghhops_server'.
error AttributeError: module 'ghhops_server' has no attribute 'endpoint'
cause The @endpoint decorator was removed in version 1.5.0.
fix
Use @Hops.route instead of @Hops.endpoint.
breaking In version 1.5.0, the decorator changed from @Hops.endpoint to @Hops.route. Old code using @Hops.endpoint will fail.
fix Replace @Hops.endpoint with @Hops.route.
gotcha The Hops server must be run on the same machine as a Rhino.Compute instance that resolves Grasshopper definitions. Without Rhino.Compute running, endpoints will fail.
fix Start Rhino.Compute (e.g., via compute.rhino3d) before running the Hops server.
deprecated The old import path 'ghhops' (without underscore) is deprecated since version 1.4.0 and will be removed in a future release.
fix Use 'from ghhops_server import Hops' instead of 'from ghhops import Hops'.

Create a minimal Hops server with a single endpoint.

from ghhops_server import Hops
import Flask

app = Flask(__name__)

@Hops.route(app)
def hello():
    return "Hello, Hops!"

if __name__ == '__main__':
    app.run()