Download the PHP package survos/jsonl-bundle without Composer

On this page you can find all versions of the php package survos/jsonl-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jsonl-bundle

Survos JsonlBundle

Streaming JSONL read/write utilities for Symfony, with first-class support for resumable writes, sidecar progress tracking, transparent gzip compression, and CLI-level inspection and querying.

JsonlBundle is intentionally small at the API surface, but feature-rich under the hood. Many of its most powerful capabilities are currently “hidden” because they require no extra code once you adopt the bundle’s reader/writer abstractions.

This README makes those capabilities explicit, with concrete, copy-pasteable examples.


Why JSONL?

JSON Lines (.jsonl) is the ideal format for:

JsonlBundle embraces these properties rather than fighting them.


Installation

Symfony Flex will register the bundle automatically.


Core Concepts

Files

Sidecar

Every JSONL file written with JsonlWriter has an optional sidecar file that tracks:

Sidecars enable resume, progress inspection, and CLI tooling.

Compression

If the filename ends in .gz, compression is automatic.

No flags. No config. Just naming.


Writing JSONL

Basic Write (Overwrite by Default)

By default, JsonlWriter::open() uses overwrite mode ('w'), matching PHP’s fopen() semantics.

This means:

This immediately gives you:


Append vs Overwrite

JsonlBundle makes dataset intent explicit via write modes.

Append to an Existing Dataset

Use append mode when resuming or extending a JSONL file:

Append mode:


Overwrite an Existing Dataset

Overwrite mode is intentional and destructive:

Overwrite mode:

No buffering required. Memory-safe for large datasets.


Resume a Partial Write

If the process crashes midway, reopen the file in append mode:

The writer will:


Writing with Gzip Compression

Just use .gz — mode semantics are unchanged:

Features retained:


Writer Options

Advanced behavior is controlled via JsonlWriterOptions, passed as the third argument to JsonlWriter::open().

Options configure policy, not mechanics. Defaults are safe and explicit.

Example: Overwrite and Ensure Directory Exists

In this example:

Avoid overwrite mode ('w') for resumable pipelines. Append mode with sidecars is the intended default for long-running jobs.

For the full list of writer options and their semantics, see:


Reading JSONL

Basic Read

The reader:


Read with Offset (Resume Processing)

Ideal for batch pipelines and workers.


Sidecar Files (The Hidden Superpower)

For a file:

JsonlBundle maintains:

What’s Inside the Sidecar?

Typical contents:

You do not manage this manually.


Query Progress Programmatically


Mark Completion Explicitly

This is especially useful in multi-stage pipelines.


CLI Utilities

JsonlBundle ships with CLI tooling to inspect files without writing code.

Inspect a File

Example output:


Inspect a Gzipped File

Works exactly the same.


Peek at Records


Resume-Aware Counting

Unlike wc -l, JsonlBundle uses the sidecar:

Fast and accurate even for huge files.


Patterns Enabled by JsonlBundle

ETL Pipelines

Each step emits JSONL, resumes safely, and records progress.


Doctrine Import Pipelines


Translation Caches


Search Index Feeds


When Not to Use JsonlBundle

JsonlBundle shines in pipelines, CLI tools, and long-running jobs.


Design Philosophy


Summary

JsonlBundle is more than a reader/writer:

Most of this works automatically once you adopt JsonlWriter and JsonlReader.


Example: Caching a Remote API as JSONL (DummyJSON Products)

This example demonstrates how JsonlBundle can be used as a simple, durable cache for a remote HTTP API, without introducing a separate caching abstraction.

Goal:

This turns a one-shot HTTP call into a replayable, CLI-friendly dataset.


The Command (Minimal, Accurate API Usage)


What This Example Actually Uses

This command relies only on existing, stable APIs:

JsonlWriter

JsonlReader

No hidden methods. No imaginary helpers.


What You Still Get (Implicitly)

Even with this minimal API surface, you still benefit from:

None of this appears in the command — which is the point.


Optional Variations

Enable Compression (Zero Code Changes)

Inspect the Cache from the CLI

Re-run Offline

Once written, the command works without network access.


Why This Pattern Matters

This example shows the intended JsonlBundle workflow:

You are not “caching HTTP”. You are materializing data.

That distinction is why JsonlBundle scales cleanly from demos to production pipelines.

Inspecting JSONL Files (jsonl:info)

In addition to counting rows, JsonlBundle provides a command to inspect progress and status metadata stored in sidecar files.

Show info for a single file

Example output:

This is the fastest way to answer questions like:


Inspect a directory of JSONL files

Recurse into subdirectories

Directory mode renders a table with one row per file, including completion status and timestamps:

Rows Complete Updated Started File
170072 no 2026-01-05T14:22:09 2026-01-05T14:03:21 place.jsonl
3340 yes 2026-01-05T13:01:44 2026-01-05T12:58:10 concept.jsonl
… … … … …

Why jsonl:info matters

For deeper discussion of sidecars, resume logic, and CLI workflows, see the advanced usage guide.

Advanced Usage

This bundle is intentionally small at the surface but powerful in real-world pipelines.

For production patterns—including resume semantics, sidecar files, row counting, CLI workflows, and anti-patterns to avoid—see the advanced documentation:

👉 More examples 👉 Advanced Usage Guide

That document is where long-running jobs, API dumps, and restartable ingestion pipelines are covered in detail.

Gzip compression

The filename chooses the format: .jsonl is plain text; .jsonl.gz is gzip. Gzip defaults to level 1 (fast), including outside Symfony. Level 0 still writes a gzip stream; it does not mean a plain file.

JsonlWriter::open($path, compressionLevel: 6) overrides the configured default for that writer. Existing open writers keep their original level.

For applications with an optional-compression policy, use Jsonl::outputPath($path, compression: false) for plain JSONL, or pass an integer 0–9 for a .gz suffix and the same integer to open(compressionLevel: ...). Jsonl::resolvePath() and JsonlReader::open() find a gzip sibling when the plain path is absent; Jsonl::files() discovers both formats without duplicate cores. When both exist, the plain file wins so a new normalization cannot reuse an older compressed copy.

Reading JSONL inside a local archive

The reader can stream plain or gzipped JSONL members from a local TAR (including an uncompressed BagIt TAR), without extracting its payload. Concatenated gzip members are supported; byte offsets refer to the combined uncompressed stream. BagIt manifests and archive integrity must be verified by the application before using the input. This reader does not download S3 objects or validate BagIt.

Existing phar:///absolute/raw.bagit.tar/data/raw/obj.jsonl.gz paths also work with JsonlReader::open(). Ordinary file reads retain their existing behavior.

State and indexes remain writable local SQLite sidecars. Pass an existing cache directory explicitly; the library does not create application directories. The sidecar filename combines the archive SHA-256 and member-path hash, so distinct members and archive versions cannot accidentally reuse each other's indexes. Reopen the reader after replacing an archive; archive inputs are immutable during an open reader's lifetime.

The optional persisted row cache makes lookups independent of gzip seeking. If that cache is removed, the index still locates the uncompressed offset, but gzip requires a sequential scan to that offset. Sequential iteration always reads the archive payload, not the sidecar. Archive state/index access without an explicit local cache directory fails clearly rather than trying to write into the TAR.

This adds archive support to the reader, line counters, and index builder. Other commands that independently open files or manage sidecars need to opt into these APIs; archive support is not a claim that every command already accepts archives.


All versions of jsonl-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
survos/kit-bundle Version ^2.0
symfony/http-client Version ^7.4||^8.1
symfony/framework-bundle Version ^7.4||^8.1
symfony/dependency-injection Version ^7.4||^8.1
symfony/console Version ^7.4||^8.1
psr/log Version ^3.0
ext-zlib Version *
ext-phar Version *
ext-zip Version *
ext-pdo_sqlite Version *
symfony/lock Version ^7.4||^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package survos/jsonl-bundle contains the following files

Loading the files please wait ...