{"id":21482333,"url":"https://github.com/scottgibb/amys-fly-swapper","last_synced_at":"2026-01-08T07:05:40.323Z","repository":{"id":254185996,"uuid":"845740579","full_name":"ScottGibb/Amys-Fly-Swapper","owner":"ScottGibb","description":"A simple script to swap fly locations in a provided dataset","archived":false,"fork":false,"pushed_at":"2024-09-19T22:33:30.000Z","size":24768,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T21:32:08.667Z","etag":null,"topics":["excel","fly","python"],"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/ScottGibb.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-08-21T20:51:15.000Z","updated_at":"2024-09-19T22:32:32.000Z","dependencies_parsed_at":"2024-08-21T23:32:14.033Z","dependency_job_id":"b5077dd2-5ef7-49c5-b7a3-6dba768396ba","html_url":"https://github.com/ScottGibb/Amys-Fly-Swapper","commit_stats":null,"previous_names":["scottgibb/amys-fly-swapper"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ScottGibb/Amys-Fly-Swapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FAmys-Fly-Swapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FAmys-Fly-Swapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FAmys-Fly-Swapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FAmys-Fly-Swapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScottGibb","download_url":"https://codeload.github.com/ScottGibb/Amys-Fly-Swapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FAmys-Fly-Swapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278395869,"owners_count":25979685,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["excel","fly","python"],"created_at":"2024-11-23T12:32:22.078Z","updated_at":"2025-10-05T00:30:40.271Z","avatar_url":"https://github.com/ScottGibb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amys Fly Swapper Algorithm\n\n[![Static Code Analysis](https://github.com/ScottGibb/Amys-Fly-Swapper/actions/workflows/Static-Analysis.yml/badge.svg)](https://github.com/ScottGibb/Amys-Fly-Swapper/actions/workflows/Static-Analysis.yml)\n[![Deployment](https://github.com/ScottGibb/Amys-Fly-Swapper/actions/workflows/Deployment.yml/badge.svg)](https://github.com/ScottGibb/Amys-Fly-Swapper/actions/workflows/Deployment.yml)\n\n![Languages and Tools](./docs/Languages%20and%20Tools.png)\n\n## Summary\n\nThis repo contains a simple [script](./fly_swapper.py) that will edit a fly excel sheet and allow the user to swap the fly trajectories given a range. This is due to the software sometime mixing the trajectories and thus human intervention is required.\n\n## How to use\n\n### Download this Repository\n\n To use this repo you first need to download it and setup your virtual environment. This can be done in various ways. But a windows way can be done through using the popular IDE [vscode](https://code.visualstudio.com/download).\n To do so you can follow this [tutorial](https://www.youtube.com/watch?v=ILJ4dfOL7zs).\n\n### Set up your Virtual Environment\n\n I would recommend following this video for setting up virtual environments: [virtual environment in vscode tutorial](https://www.youtube.com/watch?v=O0bYaxUINnE)\n\n### Installing dependencies\n\nNow that your vscode(or other) virtual environment is installed, simply open the terminal(make sure your .venv is selected). You can tell by your terminal looking\nsimilar to this:\n\n![Virtual Environment](./docs/virtual%20environment%20example.png)\n\nFear not if it doesnt! Provided you have your virtual environment created you can do the following:\n\n```powershell\nPS C:\\Users\\smgib_161\\Documents\\Projects\\Amys Fly Swapper\u003e .\\.venv\\Scripts\\activate # This line here will activate your venv\n(.venv) PS C:\\Users\\smgib_161\\Documents\\Projects\\Amys Fly Swapper\u003e\n```\n\nSetting up your virtual environment is required to get the script up and running due to it requiring the dependencies outlined in [requirements.txt](./requirements.txt). Note this command will only work if you have your virtual environment setup correctly.\n\n```powershell\npip install -r requirements.txt\n```\n\nOkay so hopefully thats you now configured this repo...\n\nOn to the FUN part!!\n\n## What you need to do to make it actually do something\n\n### Fill in your sheets\n\nIn the spreadsheet that contains your flies, you must add an extra sheet called **swap**. This is so that the program knows what flies to swap and when.\nFor it to work correctly you must form this table here, an example is shown below as well as in the example folder [here](./example/trajectories%20(version%201).xlsb.xlsx)\n\n![Swap Sheet Example](./docs/swap_sheet_example.png)\n\nIn this table you will put in the flies that need to be swapped and at what frames they are swapping in and out. Both FrameStart and FrameEnd are inclusive.\n\nSo in the example above fly 1 is swapped with Fly 6 at and including frame 1 till frame 2 (inclusive). the same can be said with fly 3 and 2 from frames 1 to 10 (inclusive)\n\n### Tell the program where your excel sheet is\n\n### GUI Way\n\nSo you've decided you've had enough coding and you just want the damn thing to work... Well your in luck... maybe. Provided you have set up the previous sections, you should be able to do this:\n\n```powershell\n(.venv) PS C:\\Users\\smgib_161\\Documents\\Projects\\Amys Fly Swapper\u003e python .\\fly_swapper.py\n```\n\nThis should then fire up a GUI which will allow you to input the threshold and select a file to process.\n\nYou then should see something like this on the console:\n\n```powershell\nPS C:\\Users\\smgib_161\\Documents\\Projects\\Amys Fly Swapper\u003e .\\.venv\\Scripts\\activate\n(.venv) PS C:\\Users\\smgib_161\\Documents\\Projects\\Amys Fly Swapper\u003e python .\\fly_swapper.py\nINFO:root:Good job, the path .\\example\\trajectories (version 1).xlsb.xlsx exists!!\nINFO:root:There are 15 in this spreadsheet, this means there are 7.0 flys in this sheet\nINFO:root:It looks like the swap part of .\\example\\trajectories (version 1).xlsb.xlsx is correctly formatted!\nINFO:root:Brace yourself—it's about to get bumpier than a night out with too much tequila\nINFO:root:I Detected 2 swaps! Time to get swapping!!\nINFO:root:Fly 1 will be swapped with fly 6 at frame 1 to frame 2\nINFO:root:Fly 3 will be swapped with fly 2 at frame 1 to frame 10\nINFO:root:Right about now I would start thinking about thanking scott....\n(.venv) PS C:\\Users\\smgib_161\\Documents\\Projects\\Amys Fly Swapper\u003e\n```\n\n## Making an Executable\n\nWe can also make the code into an exectutable by using the following command:\n\n```powershell\npyinstaller --onefile --name=\"Fly Swapper 3000\" --icon=\".\\docs\\\\SG Logo.ico\" --add-data \".\\docs\\;docs\" fly_swapper.py\n```\n\nIn order for this to work you will need the following dependencies.\n\n```powershell\npip install pyinstaller\n```\n\n## Useful Links\n\n- [Absolute vs Relative Paths](https://www.computerhope.com/issues/ch001708.htm)\n- [idtracker.ai](https://idtracker.ai/latest/)\n- [pyinstaller](https://pyinstaller.org/en/stable/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottgibb%2Famys-fly-swapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottgibb%2Famys-fly-swapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottgibb%2Famys-fly-swapper/lists"}