waghbhaskar / data-canvas
A PHP class for mapping dataset from various sources
dev-main
2025-08-17 17:44 UTC
This package is auto-updated.
Last update: 2026-04-17 19:22:22 UTC
README
DataSetMapper is a robust PHP 8.1+ library that helps you standardize input datasets from multiple sources (CSV, JSON, TXT, Arrays) into a consistent, client-specific format.
β¨ Key Features
- π₯ Flexible Data Loading β Load data from
.csv,.json(file/string), delimited.txt, and native PHP arrays. - πΊοΈ Customizable Mapping Schema β Use simple associative arrays to map source β target fields.
- π‘οΈ Resilient Error Handling β Handles file not found, invalid JSON, malformed TXT, etc.
- β‘ Modern PHP 8.1+ Support β Strict typing, readonly, attributes, and latest PHP features.
- π§© Null-safe Missing Fields β Missing fields become
nullwith warnings instead of breaking execution.
π¦ Installation
composer require waghbhaskar/data-canvas
π Quick Start
1οΈβ£ Define Mapping Schema
2οΈβ£ Instantiate Mapper
3οΈβ£ Load & Map CSV Data
(See GitHub repo for full examples with CSV, JSON, TXT, and PHP Arrays)
π Web Demo
Use the included index.php + output.php.
Run local server β Upload file β Choose type β Map fields β Process Data.
π€ Contributing
We welcome contributions! π
- Open an issue
- Fork & submit PRs
π License
This project is licensed under the MIT License.