waghbhaskar/data-canvas
Composer 安装命令:
composer require waghbhaskar/data-canvas
包简介
A PHP class for mapping dataset from various sources
README 文档
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.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-27