Dataset logo


Dataset is a library that lets you add your data as dependenccies to your PHP projects.
  • Project
  • Status
  • Type
    Library (Composer)
  • Language
  • License
    GPL 3.0 or later
  • Latest
    0.1.2 (2022-10-31)

Static data as composer dependencies

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!

noccylabs/dataset-postalPatterns and info for postal (zip) code validation
noccylabs/dataset-calendarBank holidays
noccylabs/dataset-iso3166ISO 3166 country codes and namess

Nifty features

Flexible + Structured

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.

Chunked loading

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.