PHPackages                             openstatspec/spss-sav - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. openstatspec/spss-sav

ActiveLibrary[CLI &amp; Console](/categories/cli)

openstatspec/spss-sav
=====================

PHP reader and writer for IBM SPSS Statistics SAV and ZSAV files

3.0.2(yesterday)015↑2700%[6 PRs](https://github.com/OpenStatSpec/php-spss/pulls)MITPHPPHP ^8.4.1CI passing

Since Mar 7Pushed yesterdayCompare

[ Source](https://github.com/OpenStatSpec/php-spss)[ Packagist](https://packagist.org/packages/openstatspec/spss-sav)[ Docs](https://github.com/OpenStatSpec/php-spss)[ RSS](/packages/openstatspec-spss-sav/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (8)Versions (15)Used By (0)

SPSS SAV/ZSAV for PHP
=====================

[](#spss-savzsav-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fa5aeb40b874e65a6d76310c11bbd9d848c040c38ae6b558416b7cd630fd82b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e73746174737065632f737073732d7361762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openstatspec/spss-sav)[![QA](https://github.com/OpenStatSpec/php-spss/actions/workflows/qa.yml/badge.svg)](https://github.com/OpenStatSpec/php-spss/actions/workflows/qa.yml)[![Total Downloads](https://camo.githubusercontent.com/75f4f8d9a4e194ec42758a5c3f6123f590a741bbe0ae25a1eec5b328967d3288/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e73746174737065632f737073732d7361762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openstatspec/spss-sav)[![License](https://camo.githubusercontent.com/055230690ee8809eb9ff7d72d8d97281904543a50eab2f49aaac85c97f89f166/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e73746174737065632f737073732d7361762f6c6963656e7365)](https://packagist.org/packages/openstatspec/spss-sav)

A PHP library for reading and writing SPSS / PSPP SAV and ZSAV data files.

Maintained by [OpenStatSpec](https://github.com/OpenStatSpec). This project continues the MIT-licensed [`tiamo/spss`](https://github.com/tiamo/spss) codebase created by Vladyslav Korniienko. The stable PHP namespace remains `SPSS\` for compatibility.

Requirements
------------

[](#requirements)

- PHP 8.4.1 or newer
- mbstring extension
- bcmath extension
- zlib extension

Installation
------------

[](#installation)

```
composer require openstatspec/spss-sav
```

Usage
-----

[](#usage)

Read a file into the v3 typed dataset model:

```
use SPSS\Sav\Reader;

$dataset = Reader::fromFile('/path/to/input.sav')->readDataset();

foreach ($dataset->rows() as $row) {
    // Values follow the order of $dataset->variables().
}
```

Write a typed dataset:

```
use SPSS\Sav\Writer;

$writer = new Writer($dataset);
$writer->save('/path/to/output.sav');
$writer->close();
```

Numeric `null` cells represent SPSS system-missing values. Strings must always be strings; an empty string is an ordinary value. SPSS dates, times, and currencies remain numeric values whose presentation is described by `VariableFormat`.

See the [v3 typed Dataset guide](./docs/index.md) for creating datasets, metadata, SAV/ZSAV support, and migration from the legacy array API. The older low-level [examples](./examples) remain available during migration.

Changelog
---------

[](#changelog)

Please have a look in [CHANGELOG](CHANGELOG.md)

Development
-----------

[](#development)

Install the locked development dependencies:

```
composer install
```

The install command activates the versioned pre-push hook in `.githooks`. It runs the same complete QA suite used in CI before every push. You can also run the checks directly:

```
composer qa
composer qa:release
```

`composer qa` validates and audits Composer dependencies, lints PHP syntax, checks coding style, runs Rector in dry-run mode, performs PHPStan level 6 analysis with strict rules, and executes the PHPUnit 13 tests. `composer qa:release` additionally enforces:

- at least 85% executable-line coverage;
- at least 74% branch coverage across the deterministic branch shards;
- Infection's mutation-testing threshold, with timeouts counted against the score and capped;
- bidirectional SAV/ZSAV interoperability with R/haven.

The release suite requires Xdebug coverage plus `Rscript` with the `haven` package. The pre-push hook runs this complete release suite. Run `composer fix` to apply safe Rector and coding-style fixes.

See [Quality and release gates](./docs/quality-gates.md) for individual commands, report locations, and the rationale for each threshold.

License
-------

[](#license)

Licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance100

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~264 days

Recently: every ~502 days

Total

14

Last Release

1d ago

Major Versions

2.3.0 → 3.0.02026-07-26

PHP version history (4 changes)2.0.0PHP &gt;=5.3.0

2.1.0PHP &gt;=5.5

2.2.2PHP &gt;=5.6

3.0.0PHP ^8.4.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6357451?v=4)[Tõnis Ormisson](/maintainers/TonisOrmisson)[@TonisOrmisson](https://github.com/TonisOrmisson)

---

Top Contributors

[![tiamo](https://avatars.githubusercontent.com/u/1963342?v=4)](https://github.com/tiamo "tiamo (100 commits)")[![lestcape](https://avatars.githubusercontent.com/u/43790722?v=4)](https://github.com/lestcape "lestcape (49 commits)")[![TonisOrmisson](https://avatars.githubusercontent.com/u/6357451?v=4)](https://github.com/TonisOrmisson "TonisOrmisson (42 commits)")[![mennodekker](https://avatars.githubusercontent.com/u/922643?v=4)](https://github.com/mennodekker "mennodekker (10 commits)")[![sinnbeck](https://avatars.githubusercontent.com/u/13980140?v=4)](https://github.com/sinnbeck "sinnbeck (6 commits)")[![arjanvlek](https://avatars.githubusercontent.com/u/10106652?v=4)](https://github.com/arjanvlek "arjanvlek (1 commits)")[![pcholewasw](https://avatars.githubusercontent.com/u/79566577?v=4)](https://github.com/pcholewasw "pcholewasw (1 commits)")[![flobee](https://avatars.githubusercontent.com/u/1349520?v=4)](https://github.com/flobee "flobee (1 commits)")[![breakliu](https://avatars.githubusercontent.com/u/827020?v=4)](https://github.com/breakliu "breakliu (1 commits)")[![blp](https://avatars.githubusercontent.com/u/613451?v=4)](https://github.com/blp "blp (1 commits)")[![sakalauskas](https://avatars.githubusercontent.com/u/1455148?v=4)](https://github.com/sakalauskas "sakalauskas (1 commits)")

---

Tags

phppsppsavspssstatisticszsavcliwriterreaderstatisticsdatasetcli-appibmspssporsavpspp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/openstatspec-spss-sav/health.svg)

```
[![Health](https://phpackages.com/badges/openstatspec-spss-sav/health.svg)](https://phpackages.com/packages/openstatspec-spss-sav)
```

###  Alternatives

[tiamo/spss

SPSS is a php-based implementation of IBM SPSS Statistics Standard

79358.3k3](/packages/tiamo-spss)[flobee/spss

SPSS is a php-based implementation of IBM SPSS Statistics Standard. (Read/write SPSS, PSPP .sav files)

1120.4k1](/packages/flobee-spss)[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.2B14.8k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.7k367.2M11.9k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k283.2M414](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.1k19.2M431](/packages/wp-cli-wp-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
