grass
grass copied to clipboard
grass.experimental: Add object to access tools as functions
This adds a Tools class which allows to access GRASS tools (modules) to be accessed using methods. Once an instance is created, calling a tool is calling a function (method) similarly to grass.jupyter.Map. Unlike grass.script, this does not require generic function name and unlike grass.pygrass module shortcuts, this does not require special objects to mimic the module families.
Outputs are handled through a returned object which is result of automatic capture of outputs and can do conversions from known formats using properties.
Usage example is in the _test() function in the file.
The code is included under new grass.experimental package which allows merging the code even when further breaking changes are anticipated.