alirashidnahal/polytext

Framework-agnostic PHP library for parsing, reading, and writing text across many file formats.

Maintainers

Package info

github.com/alirashidnahal/polytext

pkg:composer/alirashidnahal/polytext

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-07-10 20:40 UTC

This package is auto-updated.

Last update: 2026-07-10 20:44:01 UTC


README

Framework-agnostic PHP library for parsing, reading, and writing text across many file formats.

Requirements

  • PHP 8.3+
  • Extensions: dom, fileinfo, json, mbstring, zip

Installation

composer require alirashidnahal/polytext

Quick Start

use Alirashidnahal\Polytext\Polytext;

$polytext = new Polytext();
$document = $polytext->open('report.docx');

foreach ($document->nodes() as $node) {
    $node->setText(strtoupper($node->text()));
}

$document->save('report-modified.docx');

Supported Formats

Category Extensions
Text txt, text, log, md, markdown
Subtitles srt, vtt, ass, ssa, sub
Web html, htm, xml
Data json, csv, yaml, yml
Office docx, odt, rtf, xlsx, xls, ods, pptx, ppt
PDF pdf

Laravel

Auto-discovery registers PolytextServiceProvider and the Polytext facade.

use Alirashidnahal\Polytext\Laravel\Facades\Polytext;

$document = Polytext::open(storage_path('app/file.docx'));

Publish config:

php artisan vendor:publish --tag=polytext-config

Development

composer install
composer test
composer analyse
composer format

License

MIT © Ali Rashidnahal