OpenSpout
OpenSpout is a community driven fork of box/spout
, a PHP library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way.
Unlike other file readers or writers, it is capable of processing very large files, while keeping the memory usage really low (less than 3MB).
Documentation
Documentation can be found at https://openspout.readthedocs.io/en/latest/.
Requirements
- PHP version 7.3 or higher
- PHP extension
php_zip
enabled - PHP extension
php_xmlreader
enabled
Upgrade from box/spout
- Replace
box/spout
withopenspout/openspout
in yourcomposer.json
- Replace
Box\Spout
withOpenSpout
in your code
Upgrade guide
Version 3 introduced new functionality but also some breaking changes. If you want to upgrade your Spout codebase from version 2 please consult the Upgrade guide.
Running tests
The main
branch includes unit, functional and performance tests.
If you just want to check that everything is working as expected, executing the unit and functional tests is enough.
phpunit
- runs unit and functional testsphpunit --group perf-tests
- only runs the performance tests
For information, the performance tests take about 10 minutes to run (processing 1 million rows files is not a quick thing).
Copyright and License
This is a fork of Box's Spout library: https://github.com/box/spout
Code until and directly descending from commit cc42c1d
is copyright of Box, Inc. and licensed under the Apache License, Version 2.0:
Code created, edited and released after the commit mentioned above is copyright of openspout Github organization and licensed under MIT License.