# box/spout

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/box-spout).**

4,229 stars · 640 forks · PHP · Apache-2.0 · archived

## Links

- GitHub: https://github.com/box/spout
- Homepage: http://opensource.box.com/spout/
- awesome-repositories: https://awesome-repositories.com/repository/box-spout.md

## Topics

`csv` `fast` `memory-efficient` `ods` `php` `reader` `scalable` `spreadsheet` `writer` `xlsx`

## Description

Spout is a spreadsheet file processing library and multi-format generator designed for reading and writing CSV, XLSX, and ODS files. It functions as a stream-based parser that processes large spreadsheet files incrementally to avoid loading entire documents into memory.

The library provides capabilities for programmatic spreadsheet generation and data extraction. It supports custom content styling, allowing for the application of fonts, backgrounds, borders, and number formats to individual cells or rows.

Beyond basic file input and output, the project covers workbook manipulation through selective sheet extraction and the modification of specific content within existing files. It employs memory-optimization strategies to handle large-scale spreadsheet processing regardless of total file size.

## Tags

### Part of an Awesome List

- [Stream-Based Parsing](https://awesome-repositories.com/f/awesome-lists/data/html-and-xml-parsing/xml-parsing/stream-based-parsing.md) — Processes large spreadsheet files incrementally using a sequential read loop to maintain constant memory usage.

### Business & Productivity Software

- [Large Scale Processing](https://awesome-repositories.com/f/business-productivity-software/excel-spreadsheet-management/large-scale-processing.md) — Handles massive CSV, XLSX, or ODS files using memory-efficient streaming to prevent crashes during reading or writing.
- [Multi-Format Spreadsheet Generators](https://awesome-repositories.com/f/business-productivity-software/multi-format-spreadsheet-generators.md) — Creates and modifies spreadsheet files across multiple formats while managing cell formatting and data structures.
- [Spreadsheet Data Extractors](https://awesome-repositories.com/f/business-productivity-software/spreadsheet-data-extractors.md) — Parses specific sheets and cell values from various workbook formats into a usable data format for analysis.
- [Spreadsheet File I/O](https://awesome-repositories.com/f/business-productivity-software/spreadsheet-file-i-o.md) — Parses various spreadsheet file formats into usable data while handling custom encodings and date conversions. ([source](https://opensource.box.com/spout/docs/))
- [Spreadsheet Manipulation Libraries](https://awesome-repositories.com/f/business-productivity-software/spreadsheet-manipulation-libraries.md) — Provides a programmatic library for reading, writing, and manipulating CSV, XLSX, and ODS files.
- [Spreadsheet Manipulation](https://awesome-repositories.com/f/business-productivity-software/spreadsheet-data-extractors/spreadsheet-manipulation.md) — Edits specific data within existing spreadsheet files to update content without replacing the entire document. ([source](https://opensource.box.com/spout/guides/))

### Data & Databases

- [Spreadsheet Generators](https://awesome-repositories.com/f/data-databases/spreadsheet-generators.md) — Enables the programmatic creation and population of formatted XLSX and ODS files from code.
- [Selective Sheet Extraction](https://awesome-repositories.com/f/data-databases/multi-file-aggregators/multi-sheet-spreadsheet-aggregation/selective-sheet-extraction.md) — Extracts data from a chosen sheet within a multi-sheet workbook to avoid processing the entire file. ([source](https://opensource.box.com/spout/guides/))
- [Spreadsheet Styling](https://awesome-repositories.com/f/data-databases/spreadsheet-generators/spreadsheet-styling.md) — Applies custom fonts, backgrounds, borders, and number formats to individual cells or rows. ([source](https://opensource.box.com/spout/docs/))

### Software Engineering & Architecture

- [Format Abstraction Interfaces](https://awesome-repositories.com/f/software-engineering-architecture/format-abstraction-interfaces.md) — Standardizes read and write operations across CSV, XLSX, and ODS formats using a common internal data representation.
- [Disk-Backed Buffer Management](https://awesome-repositories.com/f/software-engineering-architecture/disk-backed-buffer-management.md) — Writes large datasets to disk-backed temporary files before finalizing the spreadsheet to prevent memory overflow.

### User Interface & Experience

- [Selective Sheet Extraction](https://awesome-repositories.com/f/user-interface-experience/tabular-sheet-navigation/sheet-operations/selective-sheet-extraction.md) — Allows for the extraction of specific sheet data from a workbook without loading the entire file into memory.
- [Spreadsheet Cell Styling](https://awesome-repositories.com/f/user-interface-experience/cell-styling-systems/table-cell-styling/spreadsheet-cell-styling.md) — Provides capabilities to map high-level visual attributes to format-specific XML definitions for individual cells and rows.

### Web Development

- [Spreadsheet Stream Processing](https://awesome-repositories.com/f/web-development/client-side-data-ingestion/large-file-processing/spreadsheet-stream-processing.md) — Implements a memory-efficient parser that processes massive spreadsheet files incrementally to avoid RAM exhaustion.
