This small python program was made for easier use of Python Toolboxes (.pyt) in IDEs The advantage is that you can write the Toolbox in pure python and the program can convert the python-script to a real ArcGIS Toolbox afterwards.
Project description
Toolbox Converter for ArcGIS
Version 1.0.0
This small python program was made for easier use of Python Toolboxes (.pyt) in IDEs like PyCharm, Visual Studio Code, Atom and so on. The advantage is that you can write the Toolbox in pure python and the program can convert the python-script to a real Python Tool afterwards (for use in for instance ArcGIS Pro or ArcMap).
Since most IDEs don't have built in understanding of pyt-files it's a nice advantage to get the IDEs to interpret the Toolbox as a general Python-script first and then just convert it to a finished ArcGIS Tool when you want to test it in the ArcGIS Environment.
Requirements
This package requires a minimum version of Python 3.5 due to the use of common 3.5 functionalities like PathLib and F-strings. This was also made with purpose of functioning alongside the ArcGIS Pro Arcpy Library which runs on Python 3.6
Even though this uses Python 3.5 or above to function, the final Toolboxes can still be used in earlier Python versions, given that you haven't added code in the toolboxes that are not compatible with the given Python version.
Use
Install through normal pip-install or just clone this project. For pip-installation use:pip install toolbox-maker
The program contains two main functions. The first is a function that creates the inital python toolbox-script and puts it in a .py-file. The name of the file and toolbox is up to you just specify the name as following:
import toolbox_maker as tm
tm.make_python_file(name="your_chosen_name_here")
In case you want to control the folder it should be placed in you can specify the folder as the first parameter:
import toolbox_maker as tm
tm.make_python_file(name="your_chosen_name_here", path="your_path_here")
The second function is the converter itself. The only parameter it needs is what file is to be converted to a Toolbox-script. You must specify the full path here as well, although if you haven't specified a folder in the first function. The script will just use your python project folder and make its own folder there and use it for the conversion.
import toolbox_maker as tm
tm.convert_to_toolbox(file_name="file_name_and_path_here")
In case you want to specify your own paths you can do so by following the example below:
import toolbox_maker as tm
tm.convert_to_toolbox(file_name="file_name_and_path_here",
file_path="path_to_your_python_file",
dest_path="destination_path_for_the_toolbox")
Tips & Tricks
If the folder you specify in the toolbox converter does not exist, the script will create the folder in the given destination. So if you feel lazy and don't want to prepare a folder before using the script it's perfectly fine, the script will handle it for you.
Dot-descriptions are legal folder references. I.e. ./TEST/ reference a folder named "TEST" from the folder you are in, and ../ reference a folder above the folder you are in according to the folder hierarchy. These references are made legal for easier use of the folder definitions, since absolute paths are fiddly to deal with sometimes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toolbox_maker-1.0.0.tar.gz.
File metadata
- Download URL: toolbox_maker-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2de5232567f2df38fc5cad50de34b6a47dc964bc2948ec4e5d0a0584c64a4780
|
|
| MD5 |
57cca269955d97e5ee314d5a9ae22211
|
|
| BLAKE2b-256 |
df58cb32c603aeb0ae673052a56850585122101a53dfb162b8f31ade8f3ee33b
|
File details
Details for the file toolbox_maker-1.0.0-py3-none-any.whl.
File metadata
- Download URL: toolbox_maker-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d2f169bc2b45981dd0041d8f239b7ee9aa8529f775c96950bb6826cfd6268c
|
|
| MD5 |
0ec798fe6bfb0e2c4b810639d63adf1f
|
|
| BLAKE2b-256 |
171b12ba20a67527aef5ea630a81d6af818293b459f9f148ece1bdb96d825981
|