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

dev-main 2025-08-17 17:44 UTC

This package is auto-updated.

Last update: 2025-12-17 18:40:59 UTC


README

Packagist Version
Downloads
PHP Version
License

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 null with 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.