https://github.com/qax-os/excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets

https://github.com/qax-os/excelize

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

agent ai analytics chart ecma-376 excel excelize formula go mcp microsoft office ooxml spreadsheet statistics table vba visualization xlsx xml

Keywords from Contributors

embedded time-tracker productivity timetracker ontologies mesh examples distributed vulnerabilities sequences
Last synced: 9 months ago · JSON representation

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
agent ai analytics chart ecma-376 excel excelize formula go mcp microsoft office ooxml spreadsheet statistics table vba visualization xlsx xml
Created almost 10 years ago · Last pushed 10 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Security

README.md

Excelize logo

Build Status Code Coverage Go Report Card go.dev Licenses Donate

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.

Excelize

```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

QI-ANXIN Open Source

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 1,206
  • Total Committers: 269
  • Avg Commits per committer: 4.483
  • Development Distribution Score (DDS): 0.302
Past Year
  • Commits: 85
  • Committers: 41
  • Avg Commits per committer: 2.073
  • Development Distribution Score (DDS): 0.576
Top Committers
Name Email 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...

Issues and Pull Requests

Last synced: 10 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
enhancement (80) bug (67) duplicate (66) needs more info (37) in progress (19) confirmed (17) kind/documentation (5) wontfix (2) go (1) size/L (1) invalid (1)
Pull Request Labels
size/M (76) size/XS (67) size/L (52) size/S (44) dependencies (13) github_actions (8) size/XL (7) go (5) kind/documentation (3) size/XXL (2)

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.

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 0.4%
Forks count: 0.5%
Average: 4.3%
Dependent packages count: 7.0%
Dependent repos count: 9.3%
Last synced: 9 months ago
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.

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 0.4%
Forks count: 0.5%
Average: 4.3%
Dependent packages count: 7.0%
Dependent repos count: 9.3%
Last synced: 9 months ago
proxy.golang.org: github.com/qax-os/excelize/v2
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 9 months ago

Dependencies

go.mod go
  • 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
go.sum go
  • 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
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/go.yml actions
  • actions/checkout v3 composite
  • actions/setup-go v4 composite
  • codecov/codecov-action v3 composite