{"id":24761683,"url":"https://github.com/carlossanabriam/excel-transformer-script","last_synced_at":"2025-03-23T13:16:13.477Z","repository":{"id":241141935,"uuid":"804285036","full_name":"CarlosSanabriaM/excel-transformer-script","owner":"CarlosSanabriaM","description":"A Python script for modifying Excel files, setting values to 0 when a value \u003c 100 is found","archived":false,"fork":false,"pushed_at":"2024-08-18T21:12:53.000Z","size":459,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T19:18:40.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/CarlosSanabriaM.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-05-22T09:59:32.000Z","updated_at":"2024-08-18T21:12:44.000Z","dependencies_parsed_at":"2024-05-22T17:01:46.704Z","dependency_job_id":"6fd26f4c-e88a-4484-a566-9cfaca776017","html_url":"https://github.com/CarlosSanabriaM/excel-transformer-script","commit_stats":null,"previous_names":["carlossanabriam/excel-transformer-script"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosSanabriaM%2Fexcel-transformer-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosSanabriaM%2Fexcel-transformer-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosSanabriaM%2Fexcel-transformer-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosSanabriaM%2Fexcel-transformer-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarlosSanabriaM","download_url":"https://codeload.github.com/CarlosSanabriaM/excel-transformer-script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104527,"owners_count":20561380,"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":[],"created_at":"2025-01-28T19:18:54.789Z","updated_at":"2025-03-23T13:16:13.121Z","avatar_url":"https://github.com/CarlosSanabriaM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Excel transformer script\n\n![Transformation example](docs/transformation-example.png)\n\nThis project is a Python-based tool designed to modify Excel files through a terminal-based user interface.\n\nUtilizing the `openpyxl` library for Excel file manipulations and the [textual](https://github.com/Textualize/textual/tree/main) library\nfor creating an interactive terminal UI, the script performs specific data transformations while preserving cell formatting and colors.\nThe user interface guides the user to input the necessary parameters, streamlining the transformation process for enhanced usability.\n\nThe transformations are implemented using an Strategy design pattern. Currently, there are 2 strategies:\n* `SetZeroWhenNumberLowerThanAbsoluteValueStrategy`: It adjusts integer and percentage pairs in the spreadsheet,\n  setting values below 100 to zero and marking these changes with red text.\n* `SetZeroWhenNumberLowerThanRelativeValueStrategy`: Sets to zero the percentage value in pairs of columns when the integer value\n    relative to the count column (in percentage) is less than a relative value (in percentage).\n\n## Steps to execute\n\nThere are 2 scripts:\n* `script.py`: Only contains the Excel transformation logic. If you don't want to interact with the UI, you can use this script.\n  1. Edit the following variables inside the script:\n     - `input_excel_file`: Name of the input excel file (example: `input.xlsx`)\n     - `output_excel_file`: Name of the output excel file (example: `output.xlsx`)\n     - `start_column_name`: Name of the first column from which transformations should be made (example: `Eventos GFP+ (CD45+)`)\n  2. Execute the script with the following commands:\n\t ```shell\n\t pipenv shell\n\t pip install openpyxl\n\t python script.py\n\t ```\n* `script-ui.py`: Uses `textual` library to show a UI inside the terminal, improving user experience.\n  1. Execute the script with the following commands:\n\t ```shell\n\t pipenv shell\n\t pip install openpyxl textual\n\t python script-ui.py\n\t ```\n  2. Specify the values that the UI asks for\n\n## UI Screenshots\n\n\u003cimg src=\"docs/ui-start.png\" alt=\"UI start\" width=\"1200\"\u003e  \n\u003cimg src=\"docs/ui-error.png\" alt=\"UI error\" width=\"1200\"\u003e  \n\u003cimg src=\"docs/ui-success.png\" alt=\"UI success\" width=\"1200\"\u003e  \n\n## Improve UI appearance in MacOs terminal\n\nIn order to achieve the same visual appearance as the screenshots above, you may need to adjust the terminal settings on MacOs.\n\nFollow the steps detailed in the following `textual` FAQ question:\n[Why doesn't Textual look good on macOS?](https://textual.textualize.io/FAQ/#why-doesnt-textual-look-good-on-macos)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlossanabriam%2Fexcel-transformer-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlossanabriam%2Fexcel-transformer-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlossanabriam%2Fexcel-transformer-script/lists"}