https://github.com/qax-os/excelize
Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
8 of 269 committers (3.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.0%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
Basic Info
- Host: GitHub
- Owner: qax-os
- License: bsd-3-clause
- Language: Go
- Default Branch: master
- Homepage: https://xuri.me/excelize
- Size: 6.85 MB
Statistics
- Stars: 19,596
- Watchers: 252
- Forks: 1,830
- Open Issues: 132
- Releases: 24
Topics
Metadata Files
README.md
Excelize
Introduction
Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and writing spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Go version 1.23.0 or later. The full docs can be seen using go's built-in documentation tool, or online at go.dev and docs reference.
Basic Usage
Installation
bash
go get github.com/xuri/excelize
- If your packages are managed using Go Modules, please install with following command.
bash
go get github.com/xuri/excelize/v2
Create spreadsheet
Here is a minimal example usage that will create spreadsheet file.
```go package main
import ( "fmt"
"github.com/xuri/excelize/v2"
)
func main() { f := excelize.NewFile() defer func() { if err := f.Close(); err != nil { fmt.Println(err) } }() // Create a new sheet. index, err := f.NewSheet("Sheet2") if err != nil { fmt.Println(err) return } // Set value of a cell. f.SetCellValue("Sheet2", "A2", "Hello world.") f.SetCellValue("Sheet1", "B2", 100) // Set active sheet of the workbook. f.SetActiveSheet(index) // Save spreadsheet by the given path. if err := f.SaveAs("Book1.xlsx"); err != nil { fmt.Println(err) } } ```
Reading spreadsheet
The following constitutes the bare to read a spreadsheet document.
```go package main
import ( "fmt"
"github.com/xuri/excelize/v2"
)
func main() { f, err := excelize.OpenFile("Book1.xlsx") if err != nil { fmt.Println(err) return } defer func() { // Close the spreadsheet. if err := f.Close(); err != nil { fmt.Println(err) } }() // Get value from cell by given worksheet name and cell reference. cell, err := f.GetCellValue("Sheet1", "B2") if err != nil { fmt.Println(err) return } fmt.Println(cell) // Get all the rows in the Sheet1. rows, err := f.GetRows("Sheet1") if err != nil { fmt.Println(err) return } for _, row := range rows { for _, colCell := range row { fmt.Print(colCell, "\t") } fmt.Println() } } ```
Add chart to spreadsheet file
With Excelize chart generation and management is as easy as a few lines of code. You can build charts based on data in your worksheet or generate charts without any data in your worksheet at all.

```go package main
import ( "fmt"
"github.com/xuri/excelize/v2"
)
func main() { f := excelize.NewFile() defer func() { if err := f.Close(); err != nil { fmt.Println(err) } }() for idx, row := range [][]interface{}{ {nil, "Apple", "Orange", "Pear"}, {"Small", 2, 3, 3}, {"Normal", 5, 2, 4}, {"Large", 6, 7, 8}, } { cell, err := excelize.CoordinatesToCellName(1, idx+1) if err != nil { fmt.Println(err) return } f.SetSheetRow("Sheet1", cell, &row) } if err := f.AddChart("Sheet1", "E1", &excelize.Chart{ Type: excelize.Col3DClustered, Series: []excelize.ChartSeries{ { Name: "Sheet1!$A$2", Categories: "Sheet1!$B$1:$D$1", Values: "Sheet1!$B$2:$D$2", }, { Name: "Sheet1!$A$3", Categories: "Sheet1!$B$1:$D$1", Values: "Sheet1!$B$3:$D$3", }, { Name: "Sheet1!$A$4", Categories: "Sheet1!$B$1:$D$1", Values: "Sheet1!$B$4:$D$4", }}, Title: []excelize.RichTextRun{ { Text: "Fruit 3D Clustered Column Chart", }, }, }); err != nil { fmt.Println(err) return } // Save spreadsheet by the given path. if err := f.SaveAs("Book1.xlsx"); err != nil { fmt.Println(err) } } ```
Add picture to spreadsheet file
```go package main
import ( "fmt" _ "image/gif" _ "image/jpeg" _ "image/png"
"github.com/xuri/excelize/v2"
)
func main() { f, err := excelize.OpenFile("Book1.xlsx") if err != nil { fmt.Println(err) return } defer func() { // Close the spreadsheet. if err := f.Close(); err != nil { fmt.Println(err) } }() // Insert a picture. if err := f.AddPicture("Sheet1", "A2", "image.png", nil); err != nil { fmt.Println(err) } // Insert a picture to worksheet with scaling. if err := f.AddPicture("Sheet1", "D2", "image.jpg", &excelize.GraphicOptions{ScaleX: 0.5, ScaleY: 0.5}); err != nil { fmt.Println(err) } // Insert a picture offset in the cell with printing support. enable, disable := true, false if err := f.AddPicture("Sheet1", "H2", "image.gif", &excelize.GraphicOptions{ PrintObject: &enable, LockAspectRatio: false, OffsetX: 15, OffsetY: 10, Locked: &disable, }); err != nil { fmt.Println(err) } // Save the spreadsheet with the origin path. if err = f.Save(); err != nil { fmt.Println(err) } } ```
Contributing
Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change. XML is compliant with part 1 of the 5th edition of the ECMA-376 Standard for Office Open XML.
Licenses
This program is under the terms of the BSD 3-Clause License. See https://opensource.org/licenses/BSD-3-Clause.
The Excel logo is a trademark of Microsoft Corporation. This artwork is an adaptation.
gopher.{ai,svg,png} was created by Takuya Ueda. Licensed under the Creative Commons 3.0 Attributions license.
Owner
- Name: QI-ANXIN GROUP
- Login: qax-os
- Kind: organization
- Location: China
- Website: en.qianxin.com
- Repositories: 3
- Profile: https://github.com/qax-os
QI-ANXIN Open Source
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| xuri | x****e@g****m | 842 |
| Harris | m****s@c****m | 8 |
| Olivier Mengué | d****n@c****g | 8 |
| jaby | p****r@i****m | 6 |
| Veniamin Albaev | a****k@g****m | 6 |
| Stani | s****e@g****m | 5 |
| David | J****R@h****m | 5 |
| Eng Zer Jun | e****n@g****m | 4 |
| Michael | o****8@g****m | 4 |
| dependabot[bot] | 4****] | 4 |
| rentiansheng | r****g@1****m | 4 |
| rjtee | 6****g | 3 |
| nabeyama yoshihide | y****a@g****m | 3 |
| Thomas Charbonnel | t****l | 3 |
| Rad Cirskis | n****0@g****m | 3 |
| OloloevReal | n****n@g****m | 3 |
| MengZhongYuan | 3****x | 3 |
| Ilia Mirkin | i****n@a****u | 3 |
| Liron Levin | l****n@w****o | 3 |
| Josh Fyne | j****e@e****m | 3 |
| shcabin | 5****n | 3 |
| Zhang Zhipeng | 4****5@q****m | 3 |
| ahmad | a****t@g****m | 2 |
| Zitao | 3****2@q****m | 2 |
| Steve H | s****h@g****m | 2 |
| Sharsie | S****e | 2 |
| Tammy | x****e@i****m | 2 |
| R3dByt3 | m****l@w****e | 2 |
| Now-Shimmer | h****3@b****n | 2 |
| Nathan Davies | n****s@g****m | 2 |
| and 239 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 557
- Total pull requests: 279
- Average time to close issues: 3 months
- Average time to close pull requests: 13 days
- Total issue authors: 445
- Total pull request authors: 142
- Average comments per issue: 2.44
- Average comments per pull request: 1.53
- Merged pull requests: 215
- Bot issues: 0
- Bot pull requests: 13
Past Year
- Issues: 129
- Pull requests: 106
- Average time to close issues: 4 days
- Average time to close pull requests: 4 days
- Issue authors: 106
- Pull request authors: 41
- Average comments per issue: 0.92
- Average comments per pull request: 1.75
- Merged pull requests: 77
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ShowerBandV (18)
- ZQHcode (11)
- liuwangchao (6)
- usuallyvexed (4)
- podmask (4)
- ccaiy9 (4)
- firomoo (4)
- grahamorrell (4)
- Abdelaziz-Ouhammou (3)
- paolobarbolini (3)
- Zncl2222 (3)
- IvanHristov98 (3)
- yicixin (3)
- mediawall (3)
- teschste-reyrey (3)
Pull Request Authors
- dependabot[bot] (13)
- shcabin (8)
- imirkin (7)
- mengpromax (7)
- IvanHristov98 (6)
- xuri (5)
- Now-Shimmer (5)
- Juneezee (4)
- paolobarbolini (4)
- user1121114685 (4)
- DengY11 (4)
- artur-chopikian (4)
- tgulacsi (4)
- pjh591029530 (4)
- R3dByt3 (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
- Total downloads: unknown
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 29
proxy.golang.org: github.com/Qax-Os/excelize
Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Package excelize providing a set of functions that allow you to write to and read from XLSX files. Support reads and writes XLSX file generated by Microsoft Excel™ 2007 and later. Support save file without losing original charts of XLSX. This library needs Go version 1.8 or later. See https://xuri.me/excelize for more information about this package.
- Homepage: https://github.com/Qax-Os/excelize
- Documentation: https://pkg.go.dev/github.com/Qax-Os/excelize#section-documentation
- License: BSD-3-Clause
-
Latest release: v1.4.1
published about 7 years ago
Rankings
proxy.golang.org: github.com/qax-os/excelize
Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Package excelize providing a set of functions that allow you to write to and read from XLSX files. Support reads and writes XLSX file generated by Microsoft Excel™ 2007 and later. Support save file without losing original charts of XLSX. This library needs Go version 1.8 or later. See https://xuri.me/excelize for more information about this package.
- Homepage: https://github.com/qax-os/excelize
- Documentation: https://pkg.go.dev/github.com/qax-os/excelize#section-documentation
- License: BSD-3-Clause
-
Latest release: v1.4.1
published about 7 years ago
Rankings
proxy.golang.org: github.com/qax-os/excelize/v2
- Documentation: https://pkg.go.dev/github.com/qax-os/excelize/v2#section-documentation
- License: bsd-3-clause
-
Latest release: v2.9.1
published 9 months ago
Rankings
Dependencies
- github.com/davecgh/go-spew v1.1.1
- github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
- github.com/richardlehane/mscfb v1.0.4
- github.com/richardlehane/msoleps v1.0.3
- github.com/stretchr/testify v1.7.1
- github.com/xuri/efp v0.0.0-20220603152613-6918739fd470
- github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22
- golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
- golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9
- golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
- golang.org/x/text v0.3.7
- gopkg.in/yaml.v3 v3.0.0
- github.com/davecgh/go-spew v1.1.0
- github.com/davecgh/go-spew v1.1.1
- github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
- github.com/pmezard/go-difflib v1.0.0
- github.com/richardlehane/mscfb v1.0.4
- github.com/richardlehane/msoleps v1.0.1
- github.com/richardlehane/msoleps v1.0.3
- github.com/stretchr/objx v0.1.0
- github.com/stretchr/testify v1.7.1
- github.com/xuri/efp v0.0.0-20220603152613-6918739fd470
- github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22
- golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
- golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9
- golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2
- golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
- golang.org/x/sys v0.0.0-20201119102817-f84b799fce68
- golang.org/x/sys v0.0.0-20210423082822-04245dca01da
- golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
- golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
- golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
- golang.org/x/text v0.3.6
- golang.org/x/text v0.3.7
- golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
- gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
- gopkg.in/yaml.v3 v3.0.0
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v3 composite
- actions/setup-go v4 composite
- codecov/codecov-action v3 composite