承接 jotaelesalinas/php-data-streams 相关项目开发

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

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

jotaelesalinas/php-data-streams

最新稳定版本:v2.0.0

Composer 安装命令:

composer require jotaelesalinas/php-data-streams

包简介

Read and write huge CSV, JSON, XML and Excel streams in PHP without running out of memory.

README 文档

README

[!IMPORTANT] This is a breaking v2 release and is not compatible with the old jotaelesalinas/php-rwgen package. The package name, namespace, and public API have changed.

License CI

php-data-streams is a PHP streaming library for reading and writing large CSV, JSON, XML, XLSX, KML, HTTP and database-backed records without loading everything into memory.

It is designed for data pipelines, import/export jobs, CLI tools and integrations where you want small, explicit reader and writer abstractions instead of heavyweight framework-specific layers.

What it solves

  • Process large files and responses record by record.
  • Keep memory usage predictable while iterating through data.
  • Compose simple readers and writers around generators and iterables.
  • Reuse a shared contract across multiple formats.

How This Repository Is Organized

This project is a monorepo split into several smaller packages.

That means the repository contains multiple packages in one place, but you do not need to install all of them. Install only the package or packages you actually need.

For example:

  • If you only work with CSV files, install the CSV package.
  • If you only need JSON Lines, install the JSON package.
  • If you want the shared reader and writer interfaces for your own code, install the core package.

Packages

  • core for the shared Reader and Writer contracts.
  • csv for CSV and TSV readers and writers.
  • json for JSON, JSON arrays and NDJSON / JSON Lines.
  • xml for lazy XML readers and streaming XML writers.
  • kml for KML output built on XML.
  • pdo for database cursor helpers.
  • http for line and page-oriented HTTP streams.
  • excel for minimal XLSX sheet readers.

Quick Example

use JLSalinas\DataStreams\Csv\CsvReader;

$reader = new CsvReader(__DIR__ . '/customers.csv');

foreach ($reader as $customer) {
    echo $customer['name'] . PHP_EOL;
}

Installation

Install the package you need via Composer. For example, to work with CSV files:

composer require jotaelesalinas/php-data-streams-csv

If you want to work with JSON Lines:

composer require jotaelesalinas/php-data-streams-json

If you want to build your own reader or writer and only need the shared interfaces:

composer require jotaelesalinas/php-data-streams-core

You can also install more than one package if your project needs them.

Example Usage

CSV reader

use JLSalinas\DataStreams\Csv\CsvReader;

$reader = new CsvReader(__DIR__ . '/customers.csv');

foreach ($reader as $customer) {
    echo $customer['name'] . PHP_EOL;
}

CSV writer

use JLSalinas\DataStreams\Csv\CsvWriter;

$writer = new CsvWriter(__DIR__ . '/export.csv');
$writer->write(['name' => 'Ada', 'email' => 'ada@example.com']);
$writer->write(['name' => 'Grace', 'email' => 'grace@example.com']);
$writer->close();

JSON reader

use JLSalinas\DataStreams\Json\JsonReader;

$reader = new JsonReader(__DIR__ . '/events.ndjson');

foreach ($reader as $event) {
    var_dump($event);
}

Typical Use Cases

  • CSV/TSV imports and exports.
  • JSON Lines ingestion and generation.
  • XML feeds and document-to-record transforms.
  • XLSX sheet reading in long-running jobs.
  • KML generation from geospatial records.
  • Streaming database results and HTTP responses.

Project Status

This repository is the home of independently publishable packages. The codebase has been renamed and reorganized around the JLSalinas\DataStreams namespace, and each package README documents its own behavior and usage.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固