This is a Composer library that is used to load bundled data. This could be useful in a number of situations, such as seeding or updating a database with infrequently updated data. This could be geographical information, blacklists, catalogs or whatever.
For information that change frequently, Dataset doesn't solve anything. Instead, stick to the traditional approaches (such as HTTP) to handle those updates. Updating the bundled data requires using composer, which should give you an idea about what kind of data goes well as a dependency.
Here are some official datasets. As always, contributions are welcome!
Package | Description |
---|---|
noccylabs/dataset-postal | Patterns and info for postal (zip) code validation |
noccylabs/dataset-calendar | Bank holidays |
noccylabs/dataset-iso3166 | ISO 3166 country codes and namess |
Datasets can be stored as .csv or .json. In the case of .csv, the first row is assumed to contain the column keys. This means that no matter the format of the data you are reading, you will always receive a tidy array of the data.
If you have huge amounts of data to distribute, or need to load the data on a host with limited memory or resources, it will probably be nice to know that datasets can be split over multiple files, and only one file will be loaded into memory at any time. The readers hide the magic of this functionality from you, so all you have to do is get a reader and iterate it.