{"id":22307252,"url":"https://github.com/codycosta/ra-sort-5xx","last_synced_at":"2026-04-27T23:39:24.866Z","repository":{"id":260054005,"uuid":"878628845","full_name":"codycosta/RA-Sort-5XX","owner":"codycosta","description":"Quick sorting script to automate mundane work tasks. Because why spend 20 minutes doing something when you can spend 20 hours automating it :)","archived":false,"fork":false,"pushed_at":"2024-12-22T19:01:38.000Z","size":1954,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T22:23:55.406Z","etag":null,"topics":["automation","powershell","productivity","python","sorting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codycosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-25T18:40:29.000Z","updated_at":"2024-12-22T19:01:42.000Z","dependencies_parsed_at":"2024-11-17T03:27:18.631Z","dependency_job_id":"b3089b88-09f9-4c14-a3d2-9c9ddc6af31b","html_url":"https://github.com/codycosta/RA-Sort-5XX","commit_stats":null,"previous_names":["codycosta/ra_sort_kla","codycosta/ra-sort-5xx"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycosta%2FRA-Sort-5XX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycosta%2FRA-Sort-5XX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycosta%2FRA-Sort-5XX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycosta%2FRA-Sort-5XX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codycosta","download_url":"https://codeload.github.com/codycosta/RA-Sort-5XX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245568930,"owners_count":20636865,"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":["automation","powershell","productivity","python","sorting"],"created_at":"2024-12-03T20:09:10.937Z","updated_at":"2026-04-27T23:39:24.826Z","avatar_url":"https://github.com/codycosta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 5XX RA Sort Python script\n```py\n$$$$$$$\\   $$$$$$\\                                         $$\\                             \n$$  __$$\\ $$  __$$\\                                        $$ |                            \n$$ |  $$ |$$ /  $$ |         $$$$$$$\\  $$$$$$\\   $$$$$$\\ $$$$$$\\        $$$$$$\\  $$\\   $$\\ \n$$$$$$$  |$$$$$$$$ |$$$$$$\\ $$  _____|$$  __$$\\ $$  __$$\\\\_$$  _|      $$  __$$\\ $$ |  $$ |\n$$  __$$\u003c $$  __$$ |\\______|\\$$$$$$\\  $$ /  $$ |$$ |  \\__| $$ |        $$ /  $$ |$$ |  $$ |\n$$ |  $$ |$$ |  $$ |         \\____$$\\ $$ |  $$ |$$ |       $$ |$$\\     $$ |  $$ |$$ |  $$ |\n$$ |  $$ |$$ |  $$ |        $$$$$$$  |\\$$$$$$  |$$ |       \\$$$$  |$$\\ $$$$$$$  |\\$$$$$$$ |\n\\__|  \\__|\\__|  \\__|        \\_______/  \\______/ \\__|        \\____/ \\__|$$  ____/  \\____$$ |\n                                                                       $$ |      $$\\   $$ |\n                                                                       $$ |      \\$$$$$$  |\n                                                                       \\__|       \\______/\n```\n\n# Quick Section Links\n\n### [Script Usage](#usage)\n### [PowerShell Shortcuts](#creating-a-profile-function-shortcut)\n### [Download Options](#how-to-download-ra-sortpy)\n### [Setting up Python](#getting-started-with-python)\n\n\u003cbr\u003e\n\n\u003c!-- \u003e[!IMPORTANT]\n\u003e All RA.txt files and the like are blank mock-ups used for demonstrating the usage and performance of the product. No company data was published to this repository. --\u003e\n\n\u003e[!IMPORTANT]\n\u003ePlease read if you are new to using python, new to terminal scripting, or need assistance with setting up your machine.\n\n\u003e[!NOTE]\n\u003eRA-sort.py will automatically create a backup folder to dump a copy of all RA files into before sorting. This way if something were to go wrong during execution, or you as the user are unhappy with the results, there is a safe restore point to reset the folder to how it started.\n\n### Turn a cluttered directory into a well organized file storage, ready for excel!\n\n#### Setup should not take more than 20 minutes and is a one time deal, after that there's no other prerequisites to begin use. I've tried to make this guide as easy and beginner friendly as possible.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Usage\n\n## Step 0: Launch a Terminal\n#### Any terminal you have installed will work (cmd, bash, powershell, etc...)\n\n\u003cbr\u003e\n\nThe default windows terminal on our KLA machines is Windows Command Prompt. To launch this just press the windows key and type 'cmd':\\\n![image](imgs/readme-imgs/cmd-terminal.png)\n\n\u003cbr\u003e\n\nTo elevate your terminal game, I'd recommend using Powershell rather then Command Prompt, which can be easily found in the same fashion by searching for Powershell at the windows start menu:\\\n![image](imgs/readme-imgs/powershell.png)\n\n\u003cbr\u003e\n\n## Step 1: Navigate to RA folder\nFor example let's say we have some RA's that exist in the following folder:\n\n```powershell\n~/Documents/5XX/SV_RA/\n```\n\n\u003cbr\u003e\n\n## Step 2: Run RA-sort.py\nLet's say we downloaded and moved RA-sort.py to the following folder. Continue to the next section for download instructions.\n\n```powershell\n~/Documents/5XX/RA-sort.py\n```\n\n\u003e[!TIP]\n\u003eAfter downloading RA-sort.py from github here, I'd recommend keeping it (or a copy) close to, or even inside, the RA directory you intend to sort. This way, typing out the file path is not a hassle.\n\n\u003cbr\u003e\n\nYour command line execution would look something like this:\n\n\n```powershell\n~/Documents/5XX/SV_RA/ \u003e      [python | py] [path to RA-sort.py]\n\n\n\nor with the example file/folder names:\n\n~/Documents/5XX/SV_RA/ \u003e      python ../RA-sort.py\n```\n\u003e[!TIP]\n\u003eYou can use either **python** or **py** prefixes to reference the python file. \n\n\u003cbr\u003e\n\n## Optional Step 3: Organize Excel files along with RA files\n\nYou can also elect to have the script copy and organize your excel workbooks along with the RA files.\\\nTo do this, after calling RA-sort.py, add an extra argument that references the path to the blank workbook folder.\\\nSay we have our blank workbooks in the following folder:\n\n```powershell\n~/Documents/5XX/blank-workbooks/\n```\n\nTo reference this folder we would run the following:\n\n```powershell\n~/Documents/5XX/SV_RA/ \u003e     [python | py] [path to RA-sort.py] [path to blank workbooks]\n\n\n\nor with the example file/folder names:\n\n~/Documents/5XX/SV_RA/ \u003e     python ../RA-sort.py ../blank-workbooks\n```\n\n\u003e[!WARNING]\n\u003eIf you would like to do this, make sure that each of your blank excel workbooks at least has 'COG', 'EPSM', 'CETUS' and 'SL' in the name.\n\u003cbr\u003e\n\n\u003e[!TIP]\n\u003e Like with the RA-sort.py script, I recommend keeping your folder of blank excel workbooks nearby to easily access\n\u003cbr\u003e\n\nWhen organizing the excel workbooks, RA-sort.py will count the number of RA P0 files in each folder and will duplicate the needed excel workbook should the quantity of unique RA files exceed 10. This way there are the required number of excel files within each base/threshold folder.\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Example\nDuring testing, I stored some mock RA files in the following folder:\n```powershell\n~/KLA-RA-scripts/sample-RAs/\n```\n\u003cbr\u003e\n\nMy copy of RA-sort.py was stored in the previous folder:\n```powershell\n~/KLA-RA-scripts/RA-sort.py\n```\n\u003cbr\u003e\n\nAnd my blank excel workbooks in the following folder:\n```powershell\n~/KLA-RA-scripts/blank-workbooks/\n```\n\u003cbr\u003e\n\u003cbr\u003e\n\n### Executing RA-sort.py on my end would look like this:\n```powershell\n~/KLA-RA-scripts/sample-RAs/ \u003e     py ../RA-sort.py ../blank-workbooks\n```\neasy peasy :)\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003c!-- ### Before\n![image](etc/readme-imgs/cluttered-folder.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\n### After\n![image](etc/readme-imgs/cleaned-4.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e --\u003e\n\n# Creating A Profile Function Shortcut\n## Recommended for easy repeated use\n\nIf rerunning this script using the above command line arguments gets boring and repetitive, here's a shortcut to help you speed things up by assigning a powershell function to serve as an alias for the command:\n\n## Step 0: Launch a Terminal\nYou know how to do this already...(launch PowerShell)\n\n\u003cbr\u003e\n\n## Step 1: Set Your Windows Execution Policy\nto do this just run the following in any folder in the terminal:\n\n```powershell\nSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned\n```\n\n\u003cbr\u003e\n\n## Step 2: Create A Powershell Function\nThis is easy to do. Open your $profile script by running the following in any folder:\n\n```powershell\nnotepad $profile\n```\nthis should launch the profile script in none other than the windows notepad app\n\n\u003cbr\u003e\n\nHere's the basic template. Type this out in your notepad $profile window.\n\n```powershell\nfunction [some function name] { \n    [python | py] [your path to RA-sort.py] [your path to blank excel workbooks] \n}\n```\n\n#### Be sure to include the entire file and folder path for both RA-sort.py and the blank workbook folders. Using the above example files/folders here's what my function would look like:\n\n```powershell\nfunction pysort {\n    py 'C:\\Users\\Cody\\KLA_RA_scripts\\RA-sort.py' 'C:\\Users\\Cody\\KLA_RA_scripts\\blank-workbooks'\n}\n```\n\n\u003e[!IMPORTANT]\n\u003e - Remember to update this script if you download a new version release of RA-sort or move your files to different locations\n\u003e - Notice how my file and folder paths are wrapped in **quotes** ('' or \"\", doesn't matter).\\\n\u003e -- This is necessary when your file or folder names have spaces (' ') in them, but is good practice to do anyway just in case.\n\u003e - Do not end folder names with a slash '\\\\' or '/'. Listing it as ~/blank-workbooks/ will crash RA-sort.py as the OS cannot interpret the folder name and you'll receive a partial completion\n\n\u003cbr\u003e\n\nGreat! Now we have a function to call RA-sort.py without having to pass any command arguments to the terminal when running. The next time you go to run the script on a data set, all you'll need to do is call the function name:\n\n```powershell\n~/KLA-RA-scripts/sample-RAs/ \u003e     pysort\n```\n\nYou can go ahead and save and close your notepad file now!\nYou'll need to relaunch the terminal for changes to take effect.\n\n\u003e[!WARNING]\n\u003e I would recommend testing the script first and seeing some success before assigning an alias function.\\\n\u003e This ensures your spelling is correct and you have verified the files and folders arguments passed to the function are acceptable.\n\n\u003cbr\u003e\n\n\u003c!-- ### Step 3: Set Your Windows Execution Policy\n\nCopy the below command and run in any folder to allow your terminal to load the $profile file we just made each time it opens:\n\n```powershell\nSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned\n``` --\u003e\n\nYou'll need to relaunch the terminal for changes to take effect\n\n### And that's all, your terminal should be ready for shortcutting\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# How To Download RA-sort.py\n## Stable Releases (Recommended)\n\u003e[!IMPORTANT]\n\u003eTo get the latest and greatest version of the file I would recommend downloading the zip file from the Releases tab near the top of the page\n\n## Step 1. Click on releases (or the version with the attached 'Latest' tag)\n![image](imgs/readme-imgs/releases.png)\n\u003cbr\u003e\n\n## Step 2. Click on either **Source code** button to download your preferred file format, both are essentially zip files\n![image](imgs/readme-imgs/mvp.png)\n\u003cbr\u003e\n\n### This will drop a zip file of all of the repository's contents into your downloads folder. From here you can pick out RA-sort.py\n![image](imgs/readme-imgs/download-zip.png)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Experimental Pre-releases\n\u003e[!WARNING]\n\u003eRA-sort.py may not perform as intended with pre-release versions\n\n## Step 1. At the top of the page if you are reading this, click on RA-sort.py\n![image](imgs/readme-imgs/file.png)\n\u003cbr\u003e\n\n## Step 2. Next, on the top right of the file page, click the button to download raw file\n![image](imgs/readme-imgs/download.png)\n\u003cbr\u003e\n\n\n### That's it, your file will be in your downloads folder\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Getting Started With Python\n## Step 1: Make sure you have python installed (version 3.7 or later)\nPython can be downloaded from https://www.python.org/. I would recommend installing the latest version if you are unsure.\\\nTo check if your machine already has a version of python installed, simply press the windows key and search for 'python':\\\n![image](imgs/readme-imgs/check-python.png)\n\u003cbr\u003e\n\u003cbr\u003e\nIf you do not see a version installed, follow the instructions on Python's website linked above for a fresh install. After downloading, be sure to run the .exe file to install it.\n\n\u003e[!NOTE]\n\u003e During installation, the program will ask you if you would like to add Python to the system path, check this box if you see it to avoid needing to do Step 2.\\\n\u003e Step 3 is recommended to do anyway\n\n\u003cbr\u003e\n\n## Step 2: Verify Python is on Your System Path\nThis step will take the most work, but is not difficult to do\n\u003c!-- First, keep your path to python handy, we will need it later.\\ --\u003e\n\nAn easy way to check if python's executable file is found on your path is to run the following in any folder in the terminal:\n```powershell\n\u003e gcm python\n\noutput:\n\nCommandType     Name             Version    Source\n-----------     ----             -------    ------\nApplication     python.exe       3.12.31... C:\\Users\\Cody Costa\\AppData\\Local\\Programs\\Python\\Python312\\python.exe\n\n```\n\nIf you don't see a valid result with a source similar to the following then proceed with the rest of the guide: \n```powershell\nC:\\Users\\\u003cUSER\u003e\\AppData\\Local\\Programs\\Python\\Python\u003c3XX\u003e\\\n```\n\n\u003cbr\u003e\n\nPress the windows key and type out 'env', and click on **Edit the system environment variables**\n![image](imgs/readme-imgs/sys-env.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\nA new 'System Properties' window will open, and we want to click on **Environment Variables**\\\n![image](imgs/readme-imgs/sys-props.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\nThis will bring up a new window called 'Environment Variables'\\\nNavigate to the **system variables** section and click on the item labeled Path and then click **Edit**\n![image](imgs/readme-imgs/env-vars.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\nAnother new window will pop up, and we will then click on **New**\\\nIn the field that pops up, here is where you will paste in your PYTHON PATH from earlier\\\nYou can see mine listed at the bottom\\\n![image](imgs/readme-imgs/edit-vars.png)\n\u003cbr\u003e\n\n#### Go ahead and click on **OK** on all the open windows to close them, and you are done with path setup!\n\n\u003cbr\u003e\n\n## Step 3:  Diasabling Execution Aliasing\nThis part is easier than step 2.\\\nPress the windows key and search for 'app exec', and click on **Manage app execution aliases**\n![image](imgs/readme-imgs/execution.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\nScroll down until you see 2 programs named **App Installer** with python.exe and python3.exe listed below the titles.\\\nTurn both of these **OFF**\\\n![image](imgs/readme-imgs/alias-off.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n### Setup is finished, your computer is ready to run Python\n### Navigate back to the top to read about the file Usage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodycosta%2Fra-sort-5xx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodycosta%2Fra-sort-5xx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodycosta%2Fra-sort-5xx/lists"}