Skip to main content

Utilities for working with JSONL and JSON formats

Project description

jsonlutils

A lightweight Python library for working with JSONL (JSON Lines) and JSON files.
Provides easy conversion, validation, and utility functions.

✨ Features

  • Convert JSONL → JSON (with metadata)
  • Convert JSON → JSONL
  • Validate JSONL consistency
  • Extract keys from JSONL
  • Get statistics (average values, counts, etc.)
  • Stream JSONL objects with a generator

📦 Installation

bash pip install jsonlutils

import jsonlutils as ju

Convert JSONL → JSON

ju.convert_jsonl_to_json("data.jsonl", "data.json")

Convert JSON → JSONL

ju.convert_json_to_jsonl("data.json", "data.jsonl", data_key="data")

Validate consistency

is_consistent = ju.check_jsonl_is_consistent("data.jsonl") print("Consistent:", is_consistent)

Get keys

keys = ju.find_all_jsonl_keys("data.jsonl") print("Keys found:", keys)

Project details


Download files

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

Source Distribution

jsonlutils-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

jsonlutils-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jsonlutils-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for jsonlutils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 924cf6a43b7f49957d26cbb5e29d4415112fa434e31c9e342ada596d5f46957d
MD5 96691382396ce850a6e45471944c7c09
BLAKE2b-256 2c50f285d6decbe41f45470bcf7385daef624cd4e87e81988b6b24755cfd96b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jsonlutils-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for jsonlutils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2151aeb187dc9c172fea0ea1c2a6d110f2e0f4c3c01a773e7a0de29b9b35bedd
MD5 8b560c27060c5329f07a789722f9633d
BLAKE2b-256 1b05fbdf4fe23b0ad93dca87492b52dffd32905622017d15468552c729afd0c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page