{"id":18513124,"url":"https://github.com/cody-scott/pyt-metadata","last_synced_at":"2025-04-14T19:07:33.041Z","repository":{"id":175122057,"uuid":"388916866","full_name":"cody-scott/PYT-Metadata","owner":"cody-scott","description":"Metadata Tool for ArcGIS Python Toolboxes","archived":false,"fork":false,"pushed_at":"2022-02-15T14:58:52.000Z","size":29,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T19:07:28.978Z","etag":null,"topics":["arcgis","arcgis-pro","metadata","pyt","python-toolbox"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cody-scott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-23T20:18:33.000Z","updated_at":"2024-12-27T18:07:46.000Z","dependencies_parsed_at":"2023-12-19T01:01:35.821Z","dependency_job_id":"936a21a5-4a7a-4291-baa3-9480697aa742","html_url":"https://github.com/cody-scott/PYT-Metadata","commit_stats":null,"previous_names":["namur007/pyt-metadata","cody-scott/pyt-metadata"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cody-scott%2FPYT-Metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cody-scott%2FPYT-Metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cody-scott%2FPYT-Metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cody-scott%2FPYT-Metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cody-scott","download_url":"https://codeload.github.com/cody-scott/PYT-Metadata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943456,"owners_count":21186958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arcgis","arcgis-pro","metadata","pyt","python-toolbox"],"created_at":"2024-11-06T15:36:34.882Z","updated_at":"2025-04-14T19:07:33.023Z","avatar_url":"https://github.com/cody-scott.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PYT-Metadata \n\nA Metadata tool for ArcGIS Toolboxes in the Item Description style.\n\n## Description\n\nThe simple goal for this package is to attempt write everything related to your python toolbox tools in the python toolbox.  \n\nThis means your code for the non-business logic (but could also include business logic), but also your metadata, which normally is completed in ArcGIS Pro/Desktop afterwards, often as an afterthought.\n\nSince this leverages Markdown for the descriptions, writing simple full content is simple, but also allows for a lot of flexibility.\n\n## Install\n\nThis is tested in **ArcGIS Pro only**. It may work in ArcGIS Desktop, but I have not tested it.\n\nThis tool also requires `arcpy` to be in the python install used for the module, as its calling arcpy.Parameter() to obtain some of the metadata details.\n\nInstalling is simple:\n\n 1. Clone default ArcGIS Pro conda environment (if you have not already)\n 2. Switch to target environment\n 3. Install package\n \n Install:\n\n    pip install PYT-Metadata\n\nIf you are working in a jupyter notebook (ArcGIS Notebook) then you can install with the following command in a cell:\n\n    !pip install PYT-Metadata\n\n## Security\n\nBecause this tool uses the imp module to load your toolbox from source, as pyt files are not loaded by python, you need to ensure the contents of the toolbox (and any imports) satisfy your security policies. \n\nThe TLDR is: make sure you know whats inside the toolbox code before running it.\n\nUltimately when you load the toolbox in arcgis desktop/pro it will run the code anyways, but as a best practice you should understand the contents. \n\nSince you're writing metadata for this, you'll likely be one of the authors, so should have a grasp on the contents.\n\n## Usage\n\nTo add metadata to your tool, a dictionary of `meta_params` is required\n\nEach tool will have its own key in the dictionary, using its name parameter, and the value should be a dictionary the dialog and python reference.\n\nusing a multi-line string for the text is recommended, but not required. Text is a markdown structure\n\nSee the ./example/working.pyt for an example.\n\n```\nmeta_params = {\n        'tool_name_1': {\n            'dialog_reference': \"\"\"\n\n            \"\"\",\n        },\n        'tool_name_2': {\n            'dialog_reference': \"\"\"\n\n            \"\"\",\n            'python_reference': \"\"\"\n\n            \"\"\",\n        },\n        \"tags\": ['tag1'],\n        'summary':\"\"\"\n\n        \"\"\",\n        'usage': \"\"\"\n\n        \"\"\"\n    }\n```\n\nOnce you have added your metadata, call it when in your conda environment:\n\n    python -m PYT_Metadata -y ./example/working.pyt\n\nIf you do not include the -y it will prompt you to include it and a reminder about the imp module.\n\n## Output\n\nThe tool will overwrite existing files for the metadata. This means any changes made in ArcGIS Pro/Desktop will be overwritten.\n\nFurther, since this tool renders the HTML directly, it lets you add features not supported directly through the ArcGIS Metadata Editor, including codeblocks. If you edit the metadata in ArcGIS, these additional structures will be removed by ArcGIS.\n\n## Whats not supported?\n\n * Geography Metadata\n * Table Metadata\n * ArcGIS Desktop (but may still work)\n\n These may be a future addition, but are not currently supported.\n\n ## Whats next?\n\n This is a work in progress so there is a lot of room for improvement.\n\n Please share any ideas or issues you have.\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcody-scott%2Fpyt-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcody-scott%2Fpyt-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcody-scott%2Fpyt-metadata/lists"}