{"id":25699538,"url":"https://github.com/ampersandor/excel-writer","last_synced_at":"2026-06-12T04:31:45.367Z","repository":{"id":247224321,"uuid":"825162024","full_name":"ampersandor/excel-writer","owner":"ampersandor","description":"excel-writer is a Python project that provides a custom framework built on the xlsxwriter library","archived":false,"fork":false,"pushed_at":"2025-01-31T08:30:07.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T03:15:43.674Z","etag":null,"topics":["excel","framework","python","xlsxwriter"],"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/ampersandor.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-07-07T01:11:09.000Z","updated_at":"2025-01-31T08:30:10.000Z","dependencies_parsed_at":"2024-11-24T06:01:02.441Z","dependency_job_id":null,"html_url":"https://github.com/ampersandor/excel-writer","commit_stats":null,"previous_names":["ampersandor/excel-writer"],"tags_count":1,"template":false,"template_full_name":"ampersandor/python-template","purl":"pkg:github/ampersandor/excel-writer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampersandor%2Fexcel-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampersandor%2Fexcel-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampersandor%2Fexcel-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampersandor%2Fexcel-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ampersandor","download_url":"https://codeload.github.com/ampersandor/excel-writer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampersandor%2Fexcel-writer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34229624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"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","framework","python","xlsxwriter"],"created_at":"2025-02-25T03:15:45.377Z","updated_at":"2026-06-12T04:31:45.343Z","avatar_url":"https://github.com/ampersandor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"##  1.0.0\n\n\n\u003cdetails\u003e\n    \u003csummary\u003eTable of content\u003c/summary\u003e\n\n- [About](#about)\n- [Getting-Started](#getting-started)\n    - [Prerequisite](#prerequisite)\n    - [Installation](#installation)\n- [License](#license)\n- [Contact](#contact)\n- [Links](#links)    \n\u003c/details\u003e\n\n## About\n\n**excel-writer** is a Python project that provides a custom framework built on the xlsxwriter library. This framework allows you to create Sheet, Table, Column, Cell and Format objects to simplify and standardize the process of generating Excel files. By using excel-writer, you can clean up your code and ensure consistency across your Excel generation scripts.\n\n\u003cimg src=\"https://github.com/user-attachments/assets/3b552e59-544f-42ed-b6af-53745d3c15b2\" width=\"50%\"\u003e\n\n## Getting Started\n### Prerequisite\n* Python 3.12.3\n* Xlsxwriter 3.2.0\n\n### Installation\n\n#### To include in your library\n```bash\nTOKEN=YOURHTTPSTOKEN\npip install \"git+https://${TOKEN}@github.com/seegenelab/excel-writer@main\"\n# or if you have ssh key\n# pip install git+ssh://git@github.com/seegenelab/excel-writer.git\n\n\n```\n#### To develop and customize\n```commandline\ngit clone git@github.com:seegenelab/excel-writer.git\ncd excel-writer\npoetry install\npoetry shell\n\n# if you want to build\npoetry build\n```\n\n### How to use\n\n#### Use Existing Example\nThe client script shows an example about how to use the library.\n```bash\ngit clone git@github.com:seegenelab/excel-writer.git\ncd excel-writer/tests\npython3 client.py\n```\n\n#### Guide to use excel-writer\nSuppose you have a data as below, and you need to make a table with column name, subject, score, and average score.\n```python\nstudents = {\n    \"DongHun Kim\": [(\"Music\", 55), (\"Math\", 100), (\"Biology\", 60), (\"Computer Science\", 100)],\n    \"Sanghwa Han\": [(\"Math\", 100), (\"Biology\", 90), (\"Computer Science\", 100)],\n    \"Wonkyung Lee\": [(\"Music\", 98), (\"Art\", 99), (\"Biology\", 100)],\n    \"Bokyu Shin\": [(\"Math\", 99), (\"Computer Science\", 100)],\n}\n```\n\u003cimg src=\"https://github.com/user-attachments/assets/fee5f287-2032-4c74-80c2-c5f9122b1e25\" width=\"50%\"\u003e\n\nAnd your goal is to draw a table as above.\n\n##### 0. Import necessary library\n```python\nfrom excel_writer.excel_writer import ExcelWriter\nfrom excel_writer.excel import Sheet, Format, Line, Align, Border\n```\n\n##### 1. Make Sheet\n```python\n# ######################################## Make sheet ########################################\ndefault_format = Format({\"align\": \"center\", \"valign\": \"vcenter\", \"font_size\": 10,\n                     \"bold\": False, \"left\": 7, \"right\": 7})\nsheet = Sheet(\n    name=\"Students\", set_zoom=180, freeze_panes=[(2, 0)], sheet_format=default_format,\n    set_rows=[(1, 20.25)],  # set header column height as 20.25\n    set_columns=[(0, 0, 1)],  # set 0 to 0 column width as 1\n)\n```\n\n##### 2. Make Format \u0026\u0026 Table\n\n```python\n# ######################################## Make table ########################################\ntable = sheet.get_and_add_table(table_name=\"Records\", draw_from=(1, 1), table_format=default_format, filter_option=True)\n```\n\n##### 3. Make Column\n\n```python\n    # ######################################## Make columns ########################################\nname_col = table.get_and_add_column(\"Name\", width=13.5, column_format={\"left\": 2})\nsubject_col = table.get_and_add_column(\"Subject\", width=20)\nscore_col = table.get_and_add_column(\"Score\", width=4.5)\naverage_col = table.get_and_add_column(\"Average\", width=8, column_format={\"right\": 2})\n```\n\n#### 4-1. Make Header Cells\n```python\n\nheader_format = Format({\"bg_color\": \"#FDE9D9\", \"top\": 2, \"bottom\": 2, \"bold\": True})\nname_col.get_and_add_cell(\"Name\", cell_format=header_format.font_color(\"white\").bg_color(\"#E87A5D\"))\nsubject_col.get_and_add_cell(\"Subject\", cell_format=header_format.font_color(\"#F3B941\").bg_color(\"#3B5BA5\"))\nscore_col.get_and_add_cell(\"Score\", cell_format=header_format.font_color(\"#3B5BA5\").bg_color(\"#E87A5D\"))\naverage_col.get_and_add_cell(\"Average\", cell_format=header_format.font_color(\"#E87A5D\").bg_color(\"#F3B941\"))\n\n```\n\n#### 4-2. Make Body Cells\n```python\n# ######################################## Make cells ########################################\n\nfor student_name, records in students.items():\n    total = 0\n    to_be_merged = []\n    for subject, score in records:\n        name_col.get_and_add_cell(student_name)\n        subject_col.get_and_add_cell(subject)\n        score_col.get_and_add_cell(score)\n        total += score\n\n    for _ in range(len(records)):\n        cell = average_col.get_and_add_cell(round(total / len(records), 2))\n        to_be_merged.append(cell)\n\n    sheet.merge(to_be_merged)\n    table.draw_division(lvl=Divisor.NORMAL)\ntable.draw_division(lvl=Divisor.THICK)\n```\n#### 4-3. Use show method for debug\n```python\n    table.show()\n```\n\n#### 5. Generate Excel\n```python\nsheets = [sheet]\nexcel_exporter = ExcelWriter(\"output.xlsx\", sheets) # excel file name\nexcel_exporter.write_excel_sheets()  # note that you pass the list of sheet objects, not a sheet object\n```\n\n\n\n\n## Contact\nDongHun Kim - \u003cddong3525@naver.com\u003e\n\n## Links\n\n* [Website]()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampersandor%2Fexcel-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fampersandor%2Fexcel-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampersandor%2Fexcel-writer/lists"}