Skip to main content

JSON-lines and recursive reading of json-files in a path.

Project description

TestStatus PyPiStatus BlackStyle BlackPackStyle MITLicenseBadge

numpy

Uses json_numpy for transparent loads and dumps of lists into numpy-arrayrs if the dtype is either purely int or float.

trees

Recursively read (or write) .json files in a tree of directories.

lines

JSON-lines or .jsonl is a powerful extension to the JSON-family.

import json_utils as ju

with ju.lines.open("my-items.jsonl.gz", mode="w|gz") as jl:
    for i in range(100):
        jl.write({"number": i})

with ju.lines.open("my-items.jsonl.gz", mode="r|gz") as jl:
    for obj in jl:
        print("item", obj["number"])

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

Built Distribution

Supported by

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