PHPackages                             skyree/document-hash-indexer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. skyree/document-hash-indexer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

skyree/document-hash-indexer
============================

Index csv or json documents as key-hash pairs in a yaml file

v0.1(6y ago)06MITPHPPHP ^7.1CI failing

Since Dec 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Skyree/document-hash-indexer)[ Packagist](https://packagist.org/packages/skyree/document-hash-indexer)[ RSS](/packages/skyree-document-hash-indexer/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

document-hash-indexer
=====================

[](#document-hash-indexer)

This library allows you to generate an index of hashed values from a csv file or a list of json strings.

The result is a yaml file that can be easily used for quick diffs in order to spot changes, additions and deletions.

### Pre-requisite

[](#pre-requisite)

- php 7.1
- ext-json

### Installation

[](#installation)

Run `composer require skyree/document-hash-indexer` from your project.

### Getting started

[](#getting-started)

All it takes is to instantiate a `HashIndexer` and run the `hash` method with the desired key.

#### Example

[](#example)

```
$hashIndexer = new HashIndexer(new JsonParser(), new LazyErrorHandler());
$outputFile = $hashIndexer->hash('file.json', 'foo');
echo file_get_contents($outputFile);
```

with `file.json` containing the following

```
{"foo": "aaa", "bar": [{"a":  1, "b": 2}]}
{"foo": "bbb", "bar": [{"y":  4, "z": 5}]}

```

will result in

```
aaa: 7dc9c52dbf3e5a436ac2a40affed4d16
bbb: 288a8a3a1c2a8a370ea20b88b9b0f426
```

**Important note**: As mentioned in the description, for json documents, the expected input is list of json strings, not a properly formatted json object.

**Important note 2**: Make sure your input document has a unique key (a csv column whose values are all different or a json node whose value differs for each line), otherwise the generated yaml will be invalid as duplicates are forbidden.

#### Parsers

[](#parsers)

This library comes with 2 parsers:

- `ParserJson`
- `ParserCsv`

You can create and use your own parsers by implementing `ParserInterface`

#### ErrorHandlers

[](#errorhandlers)

These handlers are used to provide a behavior when a key is not found on a line; This library comes with 2 handlers:

- `LazyErrorHandler` which basically ignores the error
- `ThresholdErrorHandler` which allows up to n errors before interrupting

You can create and use your own handlers by implementing `ErrorHandlerInterface`

### Integration with Symfony

[](#integration-with-symfony)

This library can easily be defined as one or multiple services

```
Skyree\DocumentHashIndexer\Parser\JsonParser: ~

Skyree\DocumentHashIndexer\Parser\CsvParser: ~

Skyree\DocumentHashIndexer\ErrorHandler\LazyErrorHandler: ~

my_project.json_hash_indexer:
    class: Skyree\DocumentHashIndexer\HashIndexer
    arguments:
        $parser: '@Skyree\DocumentHashIndexer\Parser\JsonParser'
        $errorHandler: '@Skyree\DocumentHashIndexer\ErrorHandler\LazyErrorHandler'

my_project.csv_hash_indexer:
    class: Skyree\DocumentHashIndexer\HashIndexer
    arguments:
        $parser: '@Skyree\DocumentHashIndexer\Parser\CsvParser'
        $errorHandler: '@Skyree\DocumentHashIndexer\ErrorHandler\LazyErrorHandler'
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

2352d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1636904?v=4)[Loïc Boulakras](/maintainers/Skyree)[@Skyree](https://github.com/Skyree)

---

Top Contributors

[![Skyree](https://avatars.githubusercontent.com/u/1636904?v=4)](https://github.com/Skyree "Skyree (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/skyree-document-hash-indexer/health.svg)

```
[![Health](https://phpackages.com/badges/skyree-document-hash-indexer/health.svg)](https://phpackages.com/packages/skyree-document-hash-indexer)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[laragraph/utils

Utilities for using GraphQL with Laravel

2113.8M7](/packages/laragraph-utils)[thenextweb/passgenerator

A Laravel package to create Apple Wallet (old Passbook) compatible tickets.

297435.6k](/packages/thenextweb-passgenerator)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[wyrihaximus/html-compress

Compress/minify your HTML

841.6M31](/packages/wyrihaximus-html-compress)[keepsuit/laravel-temporal

Laravel temporal.io

4875.0k](/packages/keepsuit-laravel-temporal)

PHPackages © 2026

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