Skip to main content

Json Line library

this is a library aiming to handle json line files.

What is a Json line file (*.jsonl)

A json line file is a text file where each line is a single json document.

The advantages to have a jsonl file are:

  1. fast reading, we don't need to wait to read the entire file to know data
  2. skip lines very fast without parsing json documents
  3. we can read a jsonl file in parallel

Installation

pip install jsonl

Usage

from jsonl import Jsonl
#read whole file
data0 = [x for x in Jsonl("/path/to/file")]
#alternative to read 
data1 = list(Jsonl("/path/to/file"))

#read 100 rows after row 20
data2 = [x for x in Jsonl("/path/to/file", offset=20, limit=100)]

#write objects
data3=[{"name":"Newton"}, {"name":"Galileo"}]
Jsonl("/path/to/file","w").write(data3)

If the file is located in the cloud, you only need to configure your environment Jsonl class will handle it for aws, gcp, etc.

Jsonl can handle .zip or .gz files automatically you only need to specify the right extension in the path

#Author Pedro Mayorga.

Metadata

Release files for jsonl2 1.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsonl2 1.1.14
File Size Uploaded Provenance Actions
jsonl2-1.1.14.tar.gz 4.5 kB Without provenance Details for jsonl2-1.1.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jsonl2 1.1.14
File Interpreter ABI Platform Actions
jsonl2-1.1.14-py3-none-any.whl Python 3 none any Details for jsonl2-1.1.14-py3-none-any.whl

Total release size: 9.5 kB

Release files / jsonl2-1.1.14.tar.gz

Download URL jsonl2-1.1.14.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7eb67968c123a653230d6df86348688730c121c88ff6ac617eae79f20505226b
BLAKE2b-256 checksum
How to use checksums
939e1e5796c42766f34f142ee33be5a4f21512b18a011f118381f64b0ec2547a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / jsonl2-1.1.14-py3-none-any.whl

Download URL jsonl2-1.1.14-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
970c081369e1e613c0b56b5c7ae2e746d48977ae59bae73d1690a467e527f435
BLAKE2b-256 checksum
How to use checksums
f681fb274732e9bef62ea9191616e5bd0895643adbdf110a4d16afe446056fb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Security for jsonl2 1.1.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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