Download the PHP package frictionlessdata/tableschema without Composer
On this page you can find all versions of the php package frictionlessdata/tableschema. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frictionlessdata/tableschema
More information about frictionlessdata/tableschema
Files in frictionlessdata/tableschema
Package tableschema
Short Description A utility library for working with Table Schema
License MIT
Informations about the package tableschema
tableschema-php
A utility library for working with Table Schema in PHP.
Features summary and Usage guide
Installation
Table
Table class allows to iterate over data conforming to a table schema
Instantiate a Table object based on a data source and a table schema.
Schema can be any parameter valid for the Schema object (See below), so you can use a url or filename which contains the schema
iterate over the data, all the values are cast and validated according to the schema
validate function will validate the schema and get some sample of the data itself to validate it as well
You can instantiate a table object without schema, in this case the schema will be inferred automatically based on the data
Optionally, specify a CSV Dialect:
Table::read method allows to get all data as an array, it also supports options to modify reader behavior
read accepts an options parameter, for example:
The following options are available (the values are the default values):
Additional methods and functionality
Schema
Schema class provides helpful methods for working with a table schema and related data.
use frictionlessdata\tableschema\Schema;
Schema objects can be constructed using any of the following:
-
php array (or object)
-
string containing json
- string containg value supported by file_get_contents
The schema is loaded, parsed and validated and will raise exceptions in case of any problems.
access the schema data, which is ensured to conform to the specs.
validate function accepts the same arguemnts as the Schema constructor but returns a list of errors instead of raising exceptions
validate and cast a row of data according to the schema
will raise exception if row fails validation
it returns the row with all native values
validate the row to get a list of errors
Infer schema based on source data:
You can also create a new empty schema for editing
set fields
appropriate Field object is created according to the given descriptor (see below for Field class reference)
add / update or remove fields
set or update other table schema attributes
after every change - schema is validated and will raise Exception in case of validation errors
Finally, you can get the full validated descriptor
And, save it to a json file
Field
Field class represents a single table schema field descriptor
Create a field from a descriptor
Cast and validate values using the field
Additional method to access field data
Contributing
Please read the contribution guidelines: How to Contribute
All versions of tableschema with dependencies
ext-mbstring Version *
ext-json Version *
justinrainbow/json-schema Version ^5.2.10
nesbot/carbon Version ^2.63.0
jmikola/geojson Version ^1.0