Skip to main content

JSONL Lens

JSONL Lens is a small, dependency-free command-line tool for validating and inspecting JSON Lines files. It streams input one line at a time, so it is useful for logs, model datasets, exports, and other files that should not be loaded fully into memory.

Features

  • Reports malformed JSON with line and column numbers.
  • Counts valid records, blank lines, top-level JSON types, and common object fields.
  • Emits human-readable text or JSON for automation.
  • Streams .jsonl.gz files directly without manual decompression.
  • Reads a file or standard input.
  • Uses only the Python standard library at runtime.

Install

Install the latest published release:

python -m pip install jsonl-lens

For development from a checkout:

git clone https://github.com/BlueArt333/jsonl-lens.git
cd jsonl-lens
python -m pip install -e ".[dev]"

Usage

jsonl-lens events.jsonl
jsonl-lens archived-events.jsonl.gz
jsonl-lens events.jsonl --format json
jsonl-lens events.jsonl --require-field id --require-field timestamp
Get-Content events.jsonl | jsonl-lens

Use repeatable --require-field options to check that every object record contains the fields your pipeline expects. Non-object records are reported when this validation is enabled.

Exit status is 0 when every nonblank line is valid JSON, 1 when malformed lines are found, and 2 for file or encoding errors.

Contributing

Issues and focused pull requests are welcome. Run the checks locally with:

python -m pytest
python -m ruff check .

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonl_lens-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonl_lens-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file jsonl_lens-0.1.0.tar.gz.

File metadata

  • Download URL: jsonl_lens-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jsonl_lens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 493134be8ba5a022931ded9c537a9bf2a04aa3f323a4df39256be643f667e128
MD5 6f222013776c4a1f40a7a0108cb7c4bc
BLAKE2b-256 5d9be381396b3e71aef076de2e935673ae6e17978c237749e58e93167ab0945f

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonl_lens-0.1.0.tar.gz:

Publisher: publish.yml on BlueArt333/jsonl-lens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonl_lens-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jsonl_lens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jsonl_lens-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d33f7e8a1944d90466fe94c26dbbb69293c10ee26355979c036f585cf4d53da
MD5 60a7d2a495c524551ddd39bd0d4f19d6
BLAKE2b-256 834bb0c8b163f4bfd94e5539d945a8adca0bd4ab0b19f6ea5f99d646b9239c48

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonl_lens-0.1.0-py3-none-any.whl:

Publisher: publish.yml on BlueArt333/jsonl-lens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page