Python toolboxes are a great way to create custom, GUI toolboxes for ArcGIS without actually interacting with the GUI (since everything can be defined within the pyt file). Regrettably (and incomprehensibly) documenting a python toolbox does require the GUI (Documenting a tool in a Python toolbox). I'd like to document my toolbox as I'm developing it, and since my toolbox is constantly changing during development, I'd like code and documentation to live in the same file.
This help page also states:
For Python toolboxes, the documentation for the toolbox and tools are stored in .xml files that are associated with the toolbox and tools by name.
Since Python supports writing xml, it shouldn't be too hard to add documentation within the pyt file and dynamically create the xml file. After all, a partially complete xml file is created every time I change my python toolbox. I would imagine an approach similar to Sphinx or roxygen2 for R.
How would something like this be achieved? I've attached the automatically generated, partially complete xml file.
Solved! Go to Solution.