{"id":18595703,"url":"https://github.com/zncl2222/pyfastexcel","last_synced_at":"2025-04-10T16:31:41.054Z","repository":{"id":222237427,"uuid":"750680208","full_name":"Zncl2222/pyfastexcel","owner":"Zncl2222","description":"High performace excel writer in python","archived":false,"fork":false,"pushed_at":"2025-03-17T15:58:29.000Z","size":10778,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T00:51:42.848Z","etag":null,"topics":["excel","excelize","excelwriter","golang","high-performance","python3"],"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/Zncl2222.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-01-31T05:16:12.000Z","updated_at":"2025-03-17T15:58:34.000Z","dependencies_parsed_at":"2024-03-10T17:31:00.578Z","dependency_job_id":"20728e78-d4bb-4b22-9fa6-b9f2371cb106","html_url":"https://github.com/Zncl2222/pyfastexcel","commit_stats":null,"previous_names":["zncl2222/pyexcelize","zncl2222/pyfastexcel"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zncl2222%2Fpyfastexcel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zncl2222%2Fpyfastexcel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zncl2222%2Fpyfastexcel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zncl2222%2Fpyfastexcel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zncl2222","download_url":"https://codeload.github.com/Zncl2222/pyfastexcel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252691,"owners_count":21072701,"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":["excel","excelize","excelwriter","golang","high-performance","python3"],"created_at":"2024-11-07T01:20:46.082Z","updated_at":"2025-04-10T16:31:36.032Z","avatar_url":"https://github.com/Zncl2222.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyfastexcel\n\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Zncl2222/pyfastexcel/go.yml?logo=go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Zncl2222/pyfastexcel)](https://goreportcard.com/report/github.com/Zncl2222/pyfastexcel)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Zncl2222/pyfastexcel/pre-commit.yml?logo=pre-commit\u0026label=pre-commit)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Zncl2222/pyfastexcel/codeql.yml?logo=github\u0026label=CodeQL)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/03f42030775045b791586dee20288905)](https://app.codacy.com/gh/Zncl2222/pyfastexcel/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![codecov](https://codecov.io/gh/Zncl2222/pyfastexcel/graph/badge.svg?token=6I03AWUUWL)](https://codecov.io/gh/Zncl2222/pyfastexcel)\n[![Documentation Status](https://readthedocs.org/projects/pyfastexcel/badge/?version=stable)](https://pyfastexcel.readthedocs.io/en/stable/?badge=stable)\n\nThis package enables high-performance Excel writing by integrating with the\nstreaming API from the golang package\n[excelize](https://github.com/qax-os/excelize). Users can leverage this\nfunctionality without the need to write any Go code, as the entire process\ncan be accomplished through Python.\n\n## Features\n\n- Python and Golang Integration: Seamlessly call Golang built shared\nlibraries from Python.\n\n- No Golang Code Required: Users can solely rely on Python for Excel file\ngeneration, eliminating the need for Golang expertise.\n\n## Installation\n\n### Install via pip (Recommended)\n\nYou can easily install the package via pip\n\n```bash\npip install pyfastexcel\n```\n\n### Install manually\n\nIf you prefer to build the package manually, follow these steps:\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/Zncl2222/pyfastexcel.git\n    ```\n\n2. Go to the project root directory:\n\n    ```bash\n    cd pyfastexcel\n    ```\n\n3. Install the required golang packages:\n\n    ```bash\n    go mod download\n    ```\n\n4. Build the Golang shared library using the Makefile:\n\n    ```bash\n    make\n    ```\n\n5. Install the required python packages:\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n    or\n\n    ```bash\n    pipenv install\n    ```\n\n6. Import the project and start using it!\n\n## Requirements\n\n| Operating System | Version                         |\n| ---------------- | ------------------------------- |\n| **Linux**        | Ubuntu 18.04 or higher          |\n| **macOS**        | macOS 13 (x86-64)               |\n| **Windows**      | Windows 10 or higher            |\n\n\n### Python Versions\n\n- **Python 3.8 or higher**\n\nFor earlier versions of Python or other operating systems, compatibility is not guaranteed.\n\n## Usage\n\nThe index assignment is now avaliable in `Workbook` and the `StreamWriter`.\nHere is the example usage:\n\n```python\nfrom pyfastexcel import Workbook\nfrom pyfastexcel.utils import set_custom_style\n\n# CustomStyle will be re-implement in future to make it no-longer\n# depend on openpyxl_style writer and openpyxl\nfrom pyfastexcel import CustomStyle\n\n\nif __name__ == '__main__':\n    # Workbook\n    wb = Workbook()\n\n    # Set and register CustomStyle\n    bold_style = CustomStyle(font_size=15, font_bold=True)\n    set_custom_style('bold_style', bold_style)\n\n    ws = wb['Sheet1']\n    # Write value with default style\n    ws['A1'] = 'A1 value'\n    # Write value with custom style\n    ws['B1'] = ('B1 value', 'bold_style')\n\n    # Write value in slice with default style\n    ws['A2': 'C2'] = [1, 2, 3]\n    # Write value in slice with custom style\n    ws['A3': 'C3'] = [(1, 'bold_style'), (2, 'bold_style'), (3, 'bold_style')]\n\n    # Write value by row with default style (python index 0 is the index 1 in excel)\n    ws[3] = [9, 8, 'go']\n    # Write value by row with custom style\n    ws[4] = [(9, 'bold_style'), (8, 'bold_style'), ('go', 'bold_style')]\n\n    # Send request to golang lib and create excel\n    wb.read_lib_and_create_excel()\n\n    # File path to save\n    file_path = 'pyexample_workbook.xlsx'\n    wb.save(file_path)\n\n```\n\nFor row-by-row Excel writing, consider using `StreamWriter`, a\nsubclass of Workbook. This class is optimized for streaming large datasets.\nLearn more in the [StreamWriter](https://pyfastexcel.readthedocs.io/en/stable/writer/) documentation.\n\nExplore additional examples in the [FullExamples](https://github.com/Zncl2222/pyfastexcel/tree/main/examples).\n\n## Documentation\n\nThe documentation is hosted on Read the Docs.\n\n- [Development Version](https://pyfastexcel.readthedocs.io/en/latest/)\n\n- [Latest Stable Version](https://pyfastexcel.readthedocs.io/en/stable/)\n\n## Benchmark\n\nThe following result displays the performance comparison between\n`pyfastexcel` and `openpyxl` for writing 50000 rows with 30\ncolumns (Total 1500000 cells). To see more benchmark results, please\nsee the [benchmark](https://pyfastexcel.readthedocs.io/en/stable/benchmark/).\n\n\u003cdev align='center'\u003e\n    \u003cimg src='./docs/images/50000_30_horizontal_Windows11.png' width=\"80%\" height=\"45%\" \u003e\n\u003c/dev\u003e\n\n## How it Works\n\nThe core functionality revolves around encoding Excel cell data and styles,\nor any other Excel properties, into a JSON string within Python. This JSON\npayload is then passed through ctypes to a Golang shared library. In Golang,\nthe JSON is parsed, and using the streaming writer of\n[excelize](https://github.com/qax-os/excelize) to wrtie excel in\nhigh performance.\n\n## Current Limitations \u0026 Future Plans\n\n### Problem 1: Dependence on Other Excel Package\n\nLimitations:\n\nThis project currently depends on the `CustomStyle` object of\nthe [openpyxl_style_writer](https://github.com/Zncl2222/openpyxl_style_writer)\npackage, which is built for openpyxl to write styles in write-only\nmode more efficiently without duplicating code.\n\nFuture Plans:\n\nThis project plans to create its own `Style` object, making it no longer\ndependent on the mentioned package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzncl2222%2Fpyfastexcel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzncl2222%2Fpyfastexcel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzncl2222%2Fpyfastexcel/lists"}