Do tool metadata files HAVE to be adjacent to the python toolbox?

506
4
Jump to solution
04-07-2021 04:06 PM
EvanThoms1
New Contributor II

Is it possible to tell Pro to look in a specific folder to find the metadata files for tools in a python toolbox rather than assuming they are in the same folder as the .pyt file? This is purely a visual clutter issue, particularly because at the github repo where my toolbox is available, all of the .xml files push my readme below the fold and you have to scroll a bit to get to it. Wouldn't be a huge deal to put everything in another folder -- although I would need to go through all script files and change some relative paths -- but if there is a 'metadata path' variable I can change, I would do that.

0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Frequent Contributor

I've come across this issue before with toolboxes with many tools such as the Whitebox tools. The short answer is NO you cannot store the XML metadata files in a sub-folder.

If you access the toolbox from ArcGIS then you never see them, if you are mooching around in the folder outside the GIS then yes it does look like an awful lot of clutter. It would be good if ESRI allowed metadata to be stored in a subfolder but I suspect that would be a significant architectural change in the code and unlikely to happen until one of the developers sees the benefits of it...

View solution in original post

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

For tbx toolboxes, I store my scripts in a subfolder using relative paths defined for the scripts.  The tbx and .xml are all that are in the root of my project storage folder.  Do you use, or can you use, relative paths for pyt's or is there only 1 script in your toolbox?


... sort of retired...
0 Kudos
EvanThoms1
New Contributor II

I do the same and so, in converting a tbx to a python toolbox, I left my file structure the same and import the tool script relatively. But the metadata files still get written adjacent to the .pyt file.

0 Kudos
DuncanHornby
MVP Frequent Contributor

I've come across this issue before with toolboxes with many tools such as the Whitebox tools. The short answer is NO you cannot store the XML metadata files in a sub-folder.

If you access the toolbox from ArcGIS then you never see them, if you are mooching around in the folder outside the GIS then yes it does look like an awful lot of clutter. It would be good if ESRI allowed metadata to be stored in a subfolder but I suspect that would be a significant architectural change in the code and unlikely to happen until one of the developers sees the benefits of it...

0 Kudos
EvanThoms1
New Contributor II

Ok, I thought of doing it the way the Whitebox tools does, where xml files are not pushed to the repo in the first place, but then you don't get to write parameter descriptions.

Again, the only issue for me, really, is the listing of the files at my github repo. Guess I will be re-packaging inside of another folder.

0 Kudos