Additional functions in whitebox_tools.py
The whitebox_tools.py script provides several other functions for interacting with the WhiteboxTools library, including:
# Print the WhiteboxTools help...a listing of available commands
print(wbt.help())
# Print the WhiteboxTools license
print(wbt.license())
# Print the WhiteboxTools version
print("Version information: {}".format(wbt.version()))
# Get the toolbox associated with a tool
tb = wbt.toolbox('lidar_info')
# Retrieve a JSON object of a tool's parameters.
tp = wbt.tool_parameters('raster_histogram')
# Opens a browser and navigates to a tool's source code in the
# WhiteboxTools GitHub repository
wbt.view_code('watershed')
# Use this function to specify whether output GeoTIFF rasters should be
# compressed using the DEFLATE compression method.
wbt.set_compress_rasters(True)
For a working example of how to call functions and run tools from Python, see the whitebox_example.py Python script, which is distributed with the WhiteboxTools library.
Additional resources for using WhiteboxTools' Python interface can be found on the Tutorials site of the WhiteboxTools home page. This site contains in-depth tutorials on topics such as, 'Interpolating LiDAR data'.