承接 averay/csv 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

averay/csv

最新稳定版本:0.2.2

Composer 安装命令:

composer require averay/csv

包简介

README 文档

README

Extensions to the League CSV library to support declaring CSV schemas used for reading & writing.

Installation

composer install averay/csv

Schemas

A schema can be defined in a standalone class implementing Averay\Csv\Schema\SchemaInterface, or directly in an array on a Reader or Writer instance.

<?php
use Averay\Csv\Reader;
use Averay\Csv\Schema\Types;

$reader = Reader::createFromPath('/path/to/csv');
$reader->setSchema([
  'id' => new Types\StringType(),
  'label' => new Types\StringType(nullable: true),
  'count' => new Types\IntType(),
]);

Records retrieved from or written to a CSV will be validated against the schema. Schema keys will be used as headers for the CSV.

Additional Processing

A slugHeaders() method is provided on the Reader class, which after calling will apply a slug transformation to headers. This allows CSVs to be authored with title-cased headers but referenced by simplified slugged representations.

MIT Licenced

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-24