waghbhaskar / data-canvas
A PHP class for mapping dataset from various sources
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/waghbhaskar/data-canvas
This package is auto-updated.
Last update: 2025-12-17 18:40:59 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.