Installation and setup | simple-excel-go | Spatie       

 SPATIE  

simple-excel-go
===============

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Simple-excel-go](https://spatie.be/docs/simple-excel-go/v1)  Installation and setup

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/simple-excel-go/v1) 

  Installation and setup    
- [ Introduction ](https://spatie.be/docs/simple-excel-go/v1/introduction)
- [ Installation and setup ](https://spatie.be/docs/simple-excel-go/v1/installation-and-setup)
- [ Reading files ](https://spatie.be/docs/simple-excel-go/v1/reading-files)
- [ Writing files ](https://spatie.be/docs/simple-excel-go/v1/writing-files)
- [ Testing ](https://spatie.be/docs/simple-excel-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/simple-excel-go/v1/releasing)
- [ Changelog ](https://spatie.be/docs/simple-excel-go/v1/changelog)
- [ Support us ](https://spatie.be/docs/simple-excel-go/v1/support-us)

 Installation and setup
======================

###  On this page 

1. [ Differences from PHP ](#content-differences-from-php)

You can install the package with Go 1.27 or newer:

```
go get github.com/spatie/simple-excel-go@v0.1.0
```

Import the module using its package name:

```
import simpleexcel "github.com/spatie/simple-excel-go"
```

No Laravel application or external spreadsheet program is required. XLSX support uses [Excelize](https://github.com/qax-os/excelize). CSV and ODS use Go's buffered I/O, ZIP and XML packages. Character encoding conversion uses `golang.org/x/text`.

Differences from PHP
--------------------------------------------------------------------------------------------------------------------

The PHP package's README contains its usage guide. These docs keep that guide's reading and writing sections, with Go examples. The Rust port was a reference for typed values, formula handling and format-specific memory limits.

- Go iterators replace Laravel LazyCollections. Stop iteration with `break`, and handle the error returned alongside each row.
- `Row` has ordered `Headers` and `Values` slices. CSV values are strings. Spreadsheet values may also be numbers, booleans, `time.Time`, `time.Duration` or `Formula`. Duplicate headers remain in the slices, while `Get` returns the last matching value.
- Configure CSV delimiter, enclosure, encoding and other format settings with `ReaderOptions` or `WriterOptions`. Trimming and filtering remain chainable reader methods.
- Use `ReaderOptions.ConfigureXLSX`, `Writer.XLSX()` and native ODS styles instead of OpenSpout objects. Replace whole engines through `ReaderOptions.Open` or `WriterOptions.Backend` when you need other format behavior. There are no package-specific models, jobs or profiles.
- Call `Writer.Close()` explicitly. Go garbage collection does not finalize files. `NewStreamWriter` accepts an `io.Writer` and never exits your application or sets HTTP headers.
- XLSX formatting follows Excelize's number-format rules. Locale-dependent built-in formats can display differently from OpenSpout. ODS dates remain typed values. `PreserveDateTimeFormatting` applies only to XLSX.

Only CSV, XLSX and ODS are supported, as in PHP. Legacy binary XLS files are not supported. See the reading and writing pages for memory and formula details.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
