PHPackages                             footwork\_solutions/json\_table - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. footwork\_solutions/json\_table

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

footwork\_solutions/json\_table
===============================

A validator and storage library using the JSON table schema written in PHP.

1.0.0(10y ago)6314MITPHPPHP &gt;=5.6.0

Since Sep 8Pushed 10y ago9 watchersCompare

[ Source](https://github.com/FootworkSolutions/json_table)[ Packagist](https://packagist.org/packages/footwork_solutions/json_table)[ Docs](https://github.com/FootworkSolutions/json_table)[ RSS](/packages/footwork-solutions-json-table/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

JSON Table
==========

[](#json-table)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/08a0f6b45fcb2899fa319f8a34f15444ed351502641b344b9002fbb5f6bda95c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466f6f74776f726b536f6c7574696f6e732f6a736f6e5f7461626c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/FootworkSolutions/json_table/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/df1c338e3d2922a19ac81eefc3e0fcbf9cd11e7a4ace0716e9d4dbf6b4c334b3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466f6f74776f726b536f6c7574696f6e732f6a736f6e5f7461626c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/FootworkSolutions/json_table/?branch=master) [![Build Status](https://camo.githubusercontent.com/d0e81af6f71d7452ff258a3697c69683f97c1d0001fec774fb61410da3a96acc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466f6f74776f726b536f6c7574696f6e732f6a736f6e5f7461626c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/FootworkSolutions/json_table/build-status/master) [![Dependency Status](https://camo.githubusercontent.com/c56bc97c06d00ca0db174d5b4ccc6b404264b4e5f53043f828d7a0c63b0e2e19/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3536343436383164323263353638303032393030303035642f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/5644681d22c568002900005d)

A validator and storage library using the [JSON table schema](http://dataprotocols.org/json-table-schema/) written in PHP.

This is a great utility library for validating that CSV files, streams or any other data source validates against a predefined JSON table schema definition.

#### Limitations

[](#limitations)

Although this library has many great features, it does not (yet) adhere to the entire JSON table schema specification.

Currently the parts of the specification that are **NOT** supported are:

1. **Formats**:

    - array
    - binary (this is just validated as a string)
    - geopoint
    - geojson
2. **Constraints** currently there is no support for constraints.
3. **Foreign Keys**

    - To meet our specific needs this has been built to reference a database table and not a data package as [outlined in the specification](http://dataprotocols.org/json-table-schema/#foreign-keys).

    The same schema structure is accepted but with the following considerations: \* "datapackage" MUST be "postgresql". \* "resource" MUST be the name of the table to use with optional schema qualifier. I.E. "import.t\_table\_name". \* "fields" follow the JSON table schema specification but refer to the fields in the database table.

Motivation
==========

[](#motivation)

This library was written to fulfill a need for [Halo](http://www.halosystem.co.uk) a commercial client management system maintained by [Footwork Solutions Ltd](https://github.com/FootworkSolutions).

It is used to validate and store data as part of a import tool for users of Halo.

We use a lot of open source projects at Footwork Solutions and this project, along with our other open source work is our way of giving back to the community we appreciate so much.

Usage
=====

[](#usage)

See the [examples](https://github.com/FootworkSolutions/json_table/tree/master/examples) directory for a detailed run through of how to validate and store a CSV file.

#### Quick Start

[](#quick-start)

Validate a CSV file:

```
// Instantiate the analysis class.
$lo_analyser = new \JsonTable\Analyse();

// Let the analyser know where the JSON table schema is.
$lo_analyser->set_schema('/your/file/path/example.json');

// Let the analyser know where the CSV file to validate is.
$lo_analyser->set_file('/your/file/path/example.csv');

// Check whether the file is valid against the schema.
$lb_file_is_valid = $lo_analyser->validate();

```

Store the valid CSV file:

```
$lo_store = \JsonTable\Store::load('postgresql');
$lb_file_is_stored = $lo_store->store('your_table_name');

```

Installation
============

[](#installation)

```
composer require footwork_solutions/json_table

```

Implementation Notes
====================

[](#implementation-notes)

- datetime; date; time - fmt:\[PATTERN\] - This supports PHP date formats @see
- datetime; date; time - ISO8610 - The following formats are validated without specifing a format:
    - Combined date and time in UTC: 2015-03-09T13:07:04Z
    - Date: 2015-03-09
    - Time: hh:mm:ss
- Given the range of options that match the ISO8610 format, we recommend that you always specify a format.
- Pattens: A delimiter must be included in the regex.
- Column name checking is case insensitive.
- Foreign keys with a single field can be omitted from the CSV and the foreign key check will be ignored. However, foreign keys with multiple fields must have all those fields in the CSV file.

Contributors
============

[](#contributors)

#### Bugs &amp; Feature Requests

[](#bugs--feature-requests)

Please use the [issue tracker](https://github.com/FootworkSolutions/json_table/issues) to report any bugs or request new features.

#### Developing

[](#developing)

Pull Requests are always welcome.

Please ensure that your code meets the [PSR-1](http://www.php-fig.org/psr/psr-1), [PSR-2](http://www.php-fig.org/psr/psr-2) and [PSR-4](http://www.php-fig.org/psr/psr-4) standards.

1. [Fork](https://github.com/FootworkSolutions/json_table/fork) the repository.
2. Create your feature branch (git checkout -b my-new-feature).
3. Commit your changes.
4. Push to the branch (git push origin my-new-feature).
5. Create a new Pull Request.

Licence
=======

[](#licence)

This is free software distributed under the terms of the MIT license. See [LICENCE](https://github.com/FootworkSolutions/json_table/blob/master/LICENCE) for the full details.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

3681d ago

Major Versions

0.0.1 → 1.0.02016-04-20

PHP version history (2 changes)0.0.1-beta1PHP &gt;=5.4.0

1.0.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ca34665039f12f10d9c047b1cf3188b313ab0854123937081e7250d565aadff?d=identicon)[George\_Wilde](/maintainers/George_Wilde)

---

Top Contributors

[![georgewilde](https://avatars.githubusercontent.com/u/4067332?v=4)](https://github.com/georgewilde "georgewilde (18 commits)")

---

Tags

validationjson table schemadata protocolsopen knowledge foundation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/footwork-solutions-json-table/health.svg)

```
[![Health](https://phpackages.com/badges/footwork-solutions-json-table/health.svg)](https://phpackages.com/packages/footwork-solutions-json-table)
```

###  Alternatives

[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k489.6M672](/packages/composer-semver)[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k148.7M416](/packages/giggsey-libphonenumber-for-php)[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[opis/json-schema

Json Schema Validator for PHP

64736.9M186](/packages/opis-json-schema)[giggsey/libphonenumber-for-php-lite

A lite version of giggsey/libphonenumber-for-php, which is a PHP Port of Google's libphonenumber

8912.9M47](/packages/giggsey-libphonenumber-for-php-lite)

PHPackages © 2026

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