PHPackages                             softwarecuisine/csv-boolean-cast - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. softwarecuisine/csv-boolean-cast

ActiveHelper[PDF &amp; Document Generation](/categories/documents)

softwarecuisine/csv-boolean-cast
================================

A tiny PHP helper casts the Excel boolean words to the boolean value

1.0.1(4y ago)26MITPHPPHP &gt;=7.4.0

Since May 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/softwarecuisine/csv-boolean-cast)[ Packagist](https://packagist.org/packages/softwarecuisine/csv-boolean-cast)[ Docs](https://github.com/softwarecuisine/csv-boolean-cast)[ RSS](/packages/softwarecuisine-csv-boolean-cast/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

CSV Boolean Cast
================

[](#csv-boolean-cast)

A tiny PHP helper casts the Excel boolean words to the boolean value.

Very often some of us need to parse CSV contains boolean values. The problems happen then you need to work with non-english sources because of the different naming of `true` and `false` in different languages.

Now you don't need to look for all possible translation. This helper solve the problem.

Right now the package supports next languages:

- Basque
- German
- Danish
- Finnish
- French
- Galician
- Italian
- Catalan
- Dutch
- Norwegian
- Polish
- Portuguese, Brazil
- Portuguese, Portugal
- Russian
- Swedish
- Spanish
- Czech
- Turkish
- Hungarian

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

[](#installation)

Install CSV Boolean Cast with Composer

```
  composer require softwarecuisine/csv-boolean-cast
```

Usage/Examples
--------------

[](#usageexamples)

*CSV Sample with boolean values mixed in German and Polish*

```
id,name,company
1,Test GmbH,WAHR
2,Herr Schmidt,FALSE
3,Beispiel UG,WAHR
```

*Code example*

```
use SoftwareCuisine\CSVBooleanCast\CSVBooleanCast;

class CSVReader
{
    public function read(): void
    {
        $csv = "id,name,company
                1,Test GmbH,WAHR
                2,Herr Schmidt,FALSE
                3,Beispiel UG,WAHR";

        $result = [];

        $rows = explode(PHP_EOL, $csv);

        foreach ($rows as $index => $row) {
            if ($index > 0) {
                $columns = str_getcsv(trim($row));
                $result[] = CSVBooleanCast::cast($columns[2]);
            }
        }

        var_dump($result);
    }
}

(new CSVReader)->read();
```

*Output*

```
array(3) {
  [0] =>
  bool(true)
  [1] =>
  bool(false)
  [2] =>
  bool(true)
}
```

Used By
-------

[](#used-by)

Please, message me, if you use this package, to be mentioned here.

Authors
-------

[](#authors)

- [@softwarecuisine](https://www.github.com/softwarecuisine)

License
-------

[](#license)

[![MIT License](https://camo.githubusercontent.com/7c124530b7c185c6928998842a1a52ed4bfd21071bf67db8f325f470cc3160a3/68747470733a2f2f696d672e736869656c64732e696f2f61706d2f6c2f61746f6d69632d64657369676e2d75692e7376673f)](https://github.com/tterb/atomic-design-ui/blob/master/LICENSEs)

[MIT License Text](https://choosealicense.com/licenses/mit/)

Feedback
--------

[](#feedback)

If you have any feedback, please reach out to me at

Support
-------

[](#support)

You can support me buying a coffee

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~0 days

Total

2

Last Release

1817d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4894035?v=4)[Nikolay](/maintainers/nikolaysmeh)[@nikolaysmeh](https://github.com/nikolaysmeh)

---

Top Contributors

[![nikolaysmeh](https://avatars.githubusercontent.com/u/4894035?v=4)](https://github.com/nikolaysmeh "nikolaysmeh (2 commits)")

---

Tags

excelcsvbooleanbool

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/softwarecuisine-csv-boolean-cast/health.svg)

```
[![Health](https://phpackages.com/badges/softwarecuisine-csv-boolean-cast/health.svg)](https://phpackages.com/packages/softwarecuisine-csv-boolean-cast)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k57.6M131](/packages/openspout-openspout)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3685.2M19](/packages/gotenberg-gotenberg-php)[nuovo/spreadsheet-reader

Spreadsheet reader library for Excel, OpenOffice and structured text files

669863.2k8](/packages/nuovo-spreadsheet-reader)[faisalman/simple-excel-php

Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats

582599.4k1](/packages/faisalman-simple-excel-php)

PHPackages © 2026

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