Geogebra with JavaScript or Python

I want to use GeoGebra programmatically, i.e. define in code what I want to draw. For example, let’s suppose I want to build the following construction purely in code:

  • defining a point p in (0,0)
  • defining an integer slider s in the range(5, 10)
  • creating a Circle c centered in p and radius s
  • finding the positive intersect (p_i0) between c and xAxis
  • compute the list of p_i obtained after rotating p_i1 around p_i0 by a list of given angles (loop)

I have seen that there’s python geogebra that has a python interface and builds the objects exactly the way I want. However, I haven’t been able to find any documentation to the best of my efforts, only resorting to do dir(ggb) as instructed by someone in Reddit (r/pyggb). As suboptimal as this is, this could work if I could find all instructions I can find in the classic view of GeoGebra.

I have also seen that there’s a Javascript API which looks at least documented, but from what I have seen, you have to create the HTML from scratch, which seems to be cumbersome.

My question is: is there any way of programmatically building everything you can build with the Classic View in an interface in which I write code and it builds objects? (similar to the python version linked above)

Deal-breakers:

  • It must be a programmatic interface
  • Code must build objects as run (no building HTML by hand)

Bonus points (no deal breakers, nice to have):

  • I would prefer python over javascript
  • Online version over offline installation

Is my wishlist possible?