diff --git a/README.md b/README.md index b17f932..542b5ff 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,8 @@ -## python toolbox metadata add-on +## pyt_meta, a python toolbox metadata add-on Python toolbox metadata add-on or pyt_meta is a module that contains classes and functions that enable automated xml metadata file generation for ArcGIS toolboxes and/or any tools contained in a given toolbox. The pyt_meta module enables default metadata value generation based on the toolbox and tool class attributes/properties and the ArcGIS portal user profile. When geospatial developers wish to override and explicitly control metadata or values, the module enables developers to have full control and access to the xml metadata keys directly within the python toolbox code. As an added benefit among toolbox/tool deployments, the maintenance and packaging of XML support file documents can be eliminated from the process. This results in less file dependencies and increased toolbox deployment reliability and efficient. ### Origin -pyt_meta was developed at the National Geospatial-Intelligence Agency (NGA) by a federal government employee in the course of their official duties, so it is not subject to copyright protection and is in the public domain in the United States. - -You are free to use the core public domain portions of pyt_meta for any purpose. Modifications back to the cores of any dependency functions are subject to the original licenses and are separate from the core public domain work of pyt_meta. - -### Transparency -NGA is posting code created by government officers in their official duties in transparent platforms to increase the impact and reach of taxpayer-funded code. +pyt_meta was developed by GeoCodable to streamline toolbox deployments and ensure proper tool metadata/documentation. You are free to use the core public domain portions of pyt_meta for any purpose. Modifications back to the cores of any dependency functions are subject to the original licenses and are separate from the core public domain work of pyt_meta. ### Pull Requests If you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. This project is in the public domain within the United States and all changes to the core public domain portions will be released back into the public domain. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest. Modifications to dependencies under copyright-based open source licenses are subject to the original license conditions. @@ -23,17 +18,8 @@ The pyt_meta package is an addon feature to ArcGIS python toolboxes. As such, A ### Quick-start Install: - - For explicit instructions on your local system, download the pyt_meta_pip_helper.py script below. - Once downloaded, right click on the script, and select 'Run with ArcGIS Pro'. - The script will create tailored instructions based on the location of the local ArcGIS install and active virtual environment. - - https://github.com/ngageoint/python-toolbox-metadata-addon/blob/main/pyt_meta_pip_helper.py - - Alternatively follow the instructions below to pip install pyt_meta: - Locate the active python environment/venv for ArcGIS: - - Open IDLE from a local ArcGIS install + Locate the active python environment/venv for ArcGIS: + Open IDLE from a local ArcGIS install In the python shell run: @@ -42,7 +28,7 @@ Install: >>> print(os.path.dirname(os.path.realpath(sys.executable))) - pyt_meta can then be installed from the command line using pip: + pyt_meta can then be installed from the command line using pip: cd to the active python env identified in the step above @@ -106,7 +92,7 @@ Usage: ##--------------------------------------------------------## ### Dependencies -Most dependencies listed below are licensed under the Python Software Foundation (PSF) as distributed with the python 3 standard library. No changes were made directly to the core packages below. The original function was simply called or re-used. The arcpy package is an optional dependency of pyt_meta, but highly encouraged to enhance default metadata attribution. +Most dependencies listed below are licensed under the Python Software Foundation (PSF) as distributed with the python 3 standard library. No changes were made directly to the core packages below. The original function was simply called or re-used. importlib @@ -134,5 +120,5 @@ shutil warnings -arcpy (ESRI) -- Optional +arcpy (ESRI) diff --git a/pyt_meta_pip_helper.py b/pyt_meta_pip_helper.py deleted file mode 100644 index db70d4c..0000000 --- a/pyt_meta_pip_helper.py +++ /dev/null @@ -1,46 +0,0 @@ -import os, sys, time - -# ----------------------------------------------------------------------------- - -def get_pip_cmds(pacakge_name, github_url, wait_sec=15) : - '''Function prints instructions to perform pip installs from - a GitHUb repo. After instructions are printed, a command - line (cmd) terminal will be launched for the user after a - wait period. - :param - pacakge_name - name of package to be installed - :param - github_url - repo & version https url - :param - wait_sec - seconds to wait before opening cmd - :returns - none - - ''' - # create the standard instructions - insts = [ - '***Instructions to install: {0}***'.format(pacakge_name), - ' A command line terminal will open after {0} seconds'.format(wait_sec), - ' Note: "pip install --upgrade pip" is a recommended, but optional command\n', - ' Copy each line below into the open command line terminal one at a time:', - '-' * 115 + '\n', - ' cd "{0}"'.format(os.path.dirname(os.path.realpath(sys.executable))), - ' pip install --upgrade pip', - ' pip install git+{0}'.format(github_url), - '\n' + '-' * 115, ] - # print the instructions - [print(_) for _ in insts] - - # give the user time to read the instructions before opening cmd - print('The command line will open in:') - for _ in range(wait_sec,0,-1): - if _ > 0: - print(_, end='...\r') - time.sleep(1) - - # open cmd - os.system("start /wait cmd") - print('\nRemember to post issues, questions and feedback on GitHub @:\n\t', github_url) - -# ----------------------------------------------------------------------------- - -pacakge_name = 'pyt_meta' -github_url = r'https://github.com/ngageoint/python-toolbox-metadata-addon' -get_pip_cmds(pacakge_name, github_url, 20) - -# ----------------------------------------------------------------------------- diff --git a/setup.py b/setup.py index b429f45..6cb3503 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ setuptools.setup( name='pyt_meta', # name of the package - version='0.0.1', # release version - author='NGA', # org/author + version='1.0.0', # release version + author='GeoCodable', # org/author description=\ ''' Description: @@ -32,6 +32,8 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ], python_requires='>=3.6', # minimum version requirement of the package py_modules=['pyt_meta'], # name of the python package diff --git a/src/pyt_meta.py b/src/pyt_meta.py index c6195b1..40c4904 100644 --- a/src/pyt_meta.py +++ b/src/pyt_meta.py @@ -18,11 +18,20 @@ SubElement as et_se # ----------------------------------------------------------------------------- -__name__ = 'pyt_meta' - +__name__ = 'pyt_meta' +__alias__ = 'pyt_meta' +__author__ = 'GeoCodable' +__credits__ = ['GeoCodable'] +__version__ = '1.0.0' +__maintainer__ = 'GeoCodable' +__email__ = 'https://github.com/GeoCodable' +__github_url__ = "https://github.com/GeoCodable/pyt_meta" +__status__ = 'Beta' +__create_date__ = '20231011' +__version_date__ = '20231215' __info__ = \ ''' -Description: + Description: The pyt_meta module contains classes and functions that enable automated xml metadata file generation for ArcGIS toolboxes and/or any tools contained in a given toolbox. The pyt_meta module enables default metadata @@ -34,15 +43,6 @@ support file documents can be eliminated from the process. This results in less file dependencies and can make toolbox deployments more reliable and efficient. ''' -__alias__ = 'pyt_meta' - -__author__ = 'A. Hampton' - -__version__ = '0.0.1' - -__create_date__ = '20201124' - -__modified_date__ = '20210727' __all__ = \ [