If you like this project, you may be interested in a similar project that I did a while back using using the turtle interpretation of grammars to represent connections between LEGO bricks:
https://github.com/jncraton/connectiongrammar
The "API" is admittedly quite poor currently, as I just quickly hacked this together on top of NLTK, but I was able to put together some fun results.