You can share geoprocessing results as a package or as a service. When you share a result, ArcGIS makes a copy of your model and script tools, examines their contents, and makes changes to the copy to ensure that the tool will execute on another computer. In addition, the data that was used to create the result is also shared.
But what if you want to share your custom tools and not share any data? That is, you want to give someone your toolbox and have them use the tools within, just as they would with a system toolbox? You can do this, but it requires some skill on your part:
- All data used by your tools must be input parameters to your tool. You cannot directly reference any data in your tools since the recipient of your tool (your user) must have the data on their system. For example, if your model or script is expecting to find D:\ToolData\cfcc_codes.dbf, your tool will fail on your user's computer because they don't have D:\ToolData\cfcc_codes.dbf on their computer. If your tools expect to use particular datasets, then you must create a package.
- Since you're not delivering data with your tools (if your were, you'd package the result), your tools must be robust, meaning they must work with any dataset your user gives you. This requires good parameter definitions, error handling, and documentation.
- Your tools need to be self-contained. Ideally, you want to share just the toolbox—no ancillary Python or documentation files.
- Any intermediate or scratch data created by your tools needs to be accounted for; you'll need a writable location for your scratch data and your tools need to clean up after themselves.
- You need to test your tools thoroughly. Seemingly minor issues that you encounter running your tools locally on your computer become major issues when sharing custom tools.
When sharing custom tools and toolboxes, you have two formats in which you can deliver your tools:
- Python toolbox (.pyt)
- Custom toolbox (.tbx) with model or script tools
Python toolboxes are well-suited for delivering custom tools. All that's required is the .pyt file.
Models in a custom toolbox can be delivered as long as they don't use any custom tools that are not located in another toolbox. They can use any system tool, but you need to be aware of your user's license levels—you cannot use system tools that your user is not licensed for.
Scripts in a custom toolbox should have their code embedded in the tool. Otherwise, you will need to deliver the .py files along with the toolbox, typically using a ZIP compression utility.
- Learn more about creating custom tools
- Learn more about documenting tools
- Learn more about managing scratch data
- Learn more about embedding scripts and password protecting tools