PHPackages                             husam-awadhi/power-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. husam-awadhi/power-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

husam-awadhi/power-parser
=========================

a powerful file parsing tool

0.6.0(1y ago)0707mitPHPPHP &gt;=8.1CI passing

Since Feb 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/husamAwadhi/power-parser)[ Packagist](https://packagist.org/packages/husam-awadhi/power-parser)[ RSS](/packages/husam-awadhi-power-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (13)Used By (0)

[![PowerParser](/storage/img/logo_size_invert.jpg)](/storage/img/logo_size_invert.jpg)
======================================================================================

[](#)

[![Actions](https://camo.githubusercontent.com/2bcffcc28d3a4c56dd1fadf6394787cbb4c7de9e74f81bd1e9b8ea478b62503d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f687573616d4177616468692f706f7765722d7061727365722f6d61696e2e79616d6c3f6272616e63683d6d6173746572266c6162656c3d5465737473267374796c653d726f756e642d737175617265)](https://github.com/husamAwadhi/power-parser/actions)[![Latest Stable Version](https://camo.githubusercontent.com/4c2217774cc3cdcc04c74eed3e8ccffb221b9efc42a247cca112d3cb6f6d3099/68747470733a2f2f706f7365722e707567782e6f72672f687573616d2d6177616468692f706f7765722d7061727365722f76)](https://packagist.org/packages/husam-awadhi/power-parser)[![PHP Version Require](https://camo.githubusercontent.com/50bfd5be3cc89a09d4dbfbc63bc02bc45ab50ada2ae95ddf4bc03c45ff1d1f86/68747470733a2f2f706f7365722e707567782e6f72672f687573616d2d6177616468692f706f7765722d7061727365722f726571756972652f706870)](https://packagist.org/packages/husam-awadhi/power-parser)[![License](https://camo.githubusercontent.com/9b401a813b44ecaa3b9e3a4cbfcd307ab3cd7fd26c0943e4b3fae086f5609593/68747470733a2f2f706f7365722e707567782e6f72672f687573616d2d6177616468692f706f7765722d7061727365722f6c6963656e7365)](https://packagist.org/packages/husam-awadhi/power-parser)[![Total Downloads](https://camo.githubusercontent.com/2dc5e889974a7f288355575ae5c6e606c3aaab2b0eb0ca0e6aa02b6e085080f3/68747470733a2f2f706f7365722e707567782e6f72672f687573616d2d6177616468692f706f7765722d7061727365722f646f776e6c6f616473)](https://packagist.org/packages/husam-awadhi/power-parser)

File parsing tool with a configured blueprint design with support for `ods`, `xlsx`, `xls`, `xml`, `html`, `sylk`, `csv` file types out-of-the-box.

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

[](#installation)

Require PowerParser using [Composer](https://getcomposer.org):

```
composer require husam-awadhi/power-parser
```

Usage
-----

[](#usage)

To parse a file you'll need to a `Parser` instance which can be done by using these 3 lines. which will return the parsed file data, ready for your magic! 🎇

```
try {
    $pp = new PowerParser();
    $parser = $pp->getParserBuilder(
                stream: 'path-to-blueprint.yml',
                file: 'path-to-file.ext'
        )->build();
    $parsedData = $parser->parse()->getAsArray();
} catch (Exception $e) {
    // hmm
}
```

Blueprint
---------

[](#blueprint)

### Blueprint Basics

[](#blueprint-basics)

refer to example, [Valid Blueprint](/storage/tests/blueprints/valid.yaml)

#### Version `string`

[](#version-string)

blueprint version. not yet utilized but will be used for backward compatibility.

---

#### Meta `object`

[](#meta-object)

object contains meta data.

##### File `object`

[](#file-object)

object contains parsed file meta data.

###### Extension `string`

[](#extension-string)

parsed file extension.

###### Name `string`

[](#name-string)

parsed file name. only used in the returned parsed file data.

---

#### Blueprint `object array`

[](#blueprint-object-array)

array of main parameters to capture data in parsed file.

##### Name `string`

[](#name-string-1)

code of captured data, when returning the parsed as array this will be used as array key for the matched data.

##### Mandatory `boolean`

[](#mandatory-boolean)

when true, parsing will throw an exception if data not matched in the parsed file.

##### Conditions `objects array`

[](#conditions-objects-array)

rules and clauses for finding an element.

###### Column `integers array`

[](#column-integers-array)

expected location, a column number in Excel or CSV file

###### is, isNot, anyOf, noneOf `string` \[one only\]

[](#is-isnot-anyof-noneof-string-one-only)

Used to match the condition with the given value. If you want to use null as a value, use `"{null}"`, which will be converted in the `BlueprintInterpreter`.

##### Fields `objects array`

[](#fields-objects-array)

once a match has been found, any data defined here will be captured.

###### Name `string`

[](#name-string-2)

The name of the data found in the field. When returning the parsed data as an array, this will be used as the array key for the matched data.

###### Position `integer`

[](#position-integer)

cell number in Excel or CSV files

###### Format `format` \[optional\]

[](#format-format-optional)

formats applied to matched data, refer to [Processors](#processors)

---

### Processors

[](#processors)

processors has 2 types,

#### Casting

[](#casting)

1. bool-strict: `true`
    1. if value = `true`, `1`, `"true"`
2. bool: `false`,
    1. if value has a value and is not equal to `true`.
    2. If value is `true`, `1`, or `"true"`.
3. int: PHP casting
4. float: PHP casting

Example:

```
blueprint:
- fields:
      - name: cash
        position: 1
        type: int
```

#### Formatting

[](#formatting)

1. money
2. string length limits

Example:

```
blueprint:
- fields:
      - name: cash
        position: 1
        format: f%2 # input: 23.441 output: 23.44
      - name: cash
        position: 1
        format: s%5 # input: 'sweets' output: 'sweet'
```

License
-------

[](#license)

PowerParser is an open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~66 days

Recently: every ~26 days

Total

11

Last Release

517d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09fe8d3eb98ef74212ee2641dba0bd14ae7d430c815620bee96fbf66fb507a98?d=identicon)[husam360](/maintainers/husam360)

---

Top Contributors

[![husamAwadhi](https://avatars.githubusercontent.com/u/24761735?v=4)](https://github.com/husamAwadhi "husamAwadhi (52 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (26 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/husam-awadhi-power-parser/health.svg)

```
[![Health](https://phpackages.com/badges/husam-awadhi-power-parser/health.svg)](https://phpackages.com/packages/husam-awadhi-power-parser)
```

###  Alternatives

[sspooky13/yaml-standards

Standards for yaml files

11518.3k3](/packages/sspooky13-yaml-standards)[prohalexey/the-choice

253.3k](/packages/prohalexey-the-choice)[opensoft/simple-serializer

Simple Serializer

1914.2k1](/packages/opensoft-simple-serializer)

PHPackages © 2026

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