Skip to main content

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 Python Tool.

Project description

Toolbox Converter for ArcGIS

Version 0.0.2

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolbox_maker-0.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolbox_maker-0.0.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file toolbox_maker-0.0.2.tar.gz.

File metadata

  • Download URL: toolbox_maker-0.0.2.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

Hashes for toolbox_maker-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3b370f7ca7b78a6c378d6d1c8cfeb4e21044c7b53ad71d431998b0ddaef31321
MD5 5268a12d022af7b52b7bbb9d26c972df
BLAKE2b-256 342cbc703347b7ee41ae4e46b9b0f08eca9b41e98e28f515b8e05a7ef4f1cd45

See more details on using hashes here.

File details

Details for the file toolbox_maker-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: toolbox_maker-0.0.2-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

Hashes for toolbox_maker-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 baa1e7330763d7817bcaec6bb9716e6e9d85bcec42639e7016d9e0efbed9e8e9
MD5 afd9020a8c1a7e4c9a19f4af151c03b4
BLAKE2b-256 d2724186ed36b1159ea562642a3a201a4ec6117701e2decdf23baa59131767e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page