{"id":22363187,"url":"https://github.com/oanderoficial/csv_organized","last_synced_at":"2025-03-26T15:17:59.728Z","repository":{"id":236164274,"uuid":"792050780","full_name":"oanderoficial/CSV_organized","owner":"oanderoficial","description":"Organizar dados de um arquivo CSV em uma planilha legível ","archived":false,"fork":false,"pushed_at":"2024-07-11T11:53:55.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T16:22:29.337Z","etag":null,"topics":["csv","organized","pandas","pandas-dataframe"],"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/oanderoficial.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-04-25T22:04:18.000Z","updated_at":"2024-07-11T11:53:58.000Z","dependencies_parsed_at":"2024-06-04T23:26:28.136Z","dependency_job_id":"0836add2-d7ad-4c72-b0d4-3017455c1b43","html_url":"https://github.com/oanderoficial/CSV_organized","commit_stats":null,"previous_names":["oanderoficial/csv_organized"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2FCSV_organized","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2FCSV_organized/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2FCSV_organized/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oanderoficial%2FCSV_organized/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oanderoficial","download_url":"https://codeload.github.com/oanderoficial/CSV_organized/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245678901,"owners_count":20654738,"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":["csv","organized","pandas","pandas-dataframe"],"created_at":"2024-12-04T17:14:02.072Z","updated_at":"2025-03-26T15:17:59.693Z","avatar_url":"https://github.com/oanderoficial.png","language":"Python","readme":"\u003ch1\u003eOrganizar dados CSV \u003c/h1\u003e\n\n\u003cp\u003eOrganizar dados de um arquivo CSV em uma planilha legível \u003c/p\u003e\n\n\u003cstrong\u003e Importando bibliotecas \u003c/strong\u003e\n\u003cp\u003eInstalação:\u003c/p\u003e\n\n```\npip install pandas\n```\n```\npip install openpyxl\n```\n```\npip install tkinter\n```\n```python\n\nimport pandas as pd\nimport openpyxl\nfrom tkinter import *\nimport tkinter.messagebox as messagebox\nfrom tkinter import ttk\nfrom tkinter import filedialog\n```\n\n\n\n\u003cstrong\u003e Leitura do CSV \u003c/strong\u003e\n\n```python \n  def run (self):\n    # Leitura do CSV\n        #arquivo = input(\"Digite o caminho do arquivo gerado pelo ServiceNow \u003e\u003e\u003e\")\n        try:\n            file_path = filedialog.askopenfilename(title=\"Digite o caminho do arquivo gerado pelo ServiceNow \u003e\u003e\u003e\", filetypes=[(\"csv\", \"*.csv\")])\n            dados = pd.read_csv(file_path, encoding=\"latin-1\")\n```\n\n\u003cstrong\u003e Criação da pasta de trabalho e planilha \u003c/strong\u003e\n\n```python\njob = openpyxl.Workbook()\nplanilha = job.active\n```\n\u003cstrong\u003e Escrita dos cabeçalhos \u003c/strong\u003e\n```python\nfor i, colunas in enumerate(dados.columns):\n    planilha.cell(row=1, column=i+1).value = colunas\n```\n\n\u003cstrong\u003e Preenchimento dos dados \u003c/strong\u003e\n```python\nfor row_num, row in dados.iterrows():\n    for col_num, colunas in enumerate(row):\n        planilha.cell(row=row_num+2, column=col_num+1).value = colunas\n```\n\u003cstrong\u003e Salvamento do arquivo Excel \u003c/strong\u003e \n```python \n  job.save('arquivo_organizado.xlsx')\n            print(\"Arquivo Excel organizado com sucesso!\")\n            messagebox.showinfo('Sucesso, dados organizados com sucesso!')\n        except:\n            messagebox.showerror(\"Erro\", f\"Ocorreu um erro ao carregar o arquivo csv:\")\n             \n```\n\n```python\nif __name__ == \"__main__\":\n    run = MainExcel()\n    run.run()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foanderoficial%2Fcsv_organized","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foanderoficial%2Fcsv_organized","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foanderoficial%2Fcsv_organized/lists"}