{"id":21269398,"url":"https://github.com/jparedesds/monitoring-report","last_synced_at":"2025-03-15T11:43:25.062Z","repository":{"id":239567779,"uuid":"799922860","full_name":"jparedesDS/monitoring-report","owner":"jparedesDS","description":"The main objective of this project is to reduce report generation times and minimise errors associated with manual data entry.","archived":false,"fork":false,"pushed_at":"2024-09-17T13:45:00.000Z","size":1235,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-18T11:11:23.826Z","etag":null,"topics":["aspose","jpype","openpyxl","pandas","sql","xlswriter"],"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/jparedesDS.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-13T11:14:42.000Z","updated_at":"2024-09-17T13:45:04.000Z","dependencies_parsed_at":"2024-05-13T11:25:04.432Z","dependency_job_id":"094c912d-157c-48b2-9fd1-26616031e159","html_url":"https://github.com/jparedesDS/monitoring-report","commit_stats":null,"previous_names":["jparedesds/monitoring-report"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparedesDS%2Fmonitoring-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparedesDS%2Fmonitoring-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparedesDS%2Fmonitoring-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparedesDS%2Fmonitoring-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jparedesDS","download_url":"https://codeload.github.com/jparedesDS/monitoring-report/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243725537,"owners_count":20337667,"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":["aspose","jpype","openpyxl","pandas","sql","xlswriter"],"created_at":"2024-11-21T08:08:24.741Z","updated_at":"2025-03-15T11:43:25.039Z","avatar_url":"https://github.com/jparedesDS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monitoring Report for ERP\n\nThis script processes data extracted from an ERP and organises them in different dataframes according to their status. In addition, it generates a stylised Excel file with several sheets representing different views of the status of the documents.\n\n## Prerequisites\n\n### Necessary Libraries\nMake sure to install the following libraries before running the script:\n\n```bash\npip install pandas xlsxwriter openpyxl tqdm aspose-cells\n```\n\n## Project Structure\nThe script uses custom tools and mappings that must be included in the tools folder.\nThese tools are:\n\n- mapping_mr.py\n- apply_style_mr.py\n\n## Script functionalities\n#### Main functions\n1. Data Import and Data Cleansing\n- Loads an Excel file with information from the ERP.\n- Performs cleaning and formatting, such as filling null values and converting dates.\n2. Processing by Status\n- Divides data into different groups (Sent, Not Sent, Commented, etc.).\n- Calculates metrics such as return days, contract weeks, and additional notes.\n3. Styling and Exporting\n- Apply custom styles to dataframes.\n- Export data to an Excel file with separate sheets.\n  \n## Organisation of Excel Sheets\nEl archivo final incluye las siguientes hojas:\n\n- ALL DOC.: All documents styled according to their status.\n- ENVIADOS: Documents in \"Sent\" status.\n- SIN ENVIAR: Documents in \"Unsent\" status.\n- COMENTADOS: Documents with comments (\"Minor Com.\", \"Major Com.\", etc.).\n- STATUS: General tracking chart.\n\n## Structure of the Code\n#### Imports and Initial Configuration\nThe script imports the necessary libraries and configures the path to the data file:\n```\nimport os\nimport time\nimport pandas as pd\nimport xlsxwriter\nfrom tools.mapping_mr import *\nfrom tools.apply_style_mr import *\n```\n## Data Loading and Transformations\n#### Load the data from an Excel file and perform the following transformations:\n\n- Filling of null values.\n- Conversion of dates to datetime.\n- Calculation of additional columns such as Return Days and Contract Date.\n  \n## Processing by State\nThe data are divided into the following groups:\n\n- Annotated: Statuses such as \"Minor Com.\", \"Major Com.\" or \"Rejected\".\n- Sent: Documents marked as \"Sent\".\n- Unsent: Documents not sent.\n- Approved: Documentation finalised.\n## Final File Generation\nA stylised Excel file is created where each sheet represents a set of processed data.\n\n```\nwith pd.ExcelWriter('monitoring_report_' + str(today_date_str) + '.xlsx', engine='xlsxwriter') as writer:\n    style_sheet6.to_excel(writer, sheet_name='ALL DOC.', index=False)\n    style_sheet_2.to_excel(writer, sheet_name='ENVIADOS', index=False)\n    style_sheet_3.to_excel(writer, sheet_name='SIN ENVIAR', index=False)\n```\n\n## How to Run the Script\n1. Place the data file (data_erp.xlsx) in the specified path.\n2. Run the script with Python:\n```\npython monitoring_report.py\n```\n3. Find the generated file in the data folder.\n   \n## Additional Notes\n- Styling: Cell styles are applied according to the state of the document, using defined colours.\n- Customisation: You can adjust the columns that are processed and the colours to suit your needs.\n\n## Final Result\nThe resulting Excel file includes all the metrics and styles necessary for detailed document tracking.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjparedesds%2Fmonitoring-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjparedesds%2Fmonitoring-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjparedesds%2Fmonitoring-report/lists"}