JSON-lines and recursive reading of json-files in a path.
Project description
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
Release history Release notifications | RSS feed
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
Close
Hashes for json_utils_sebastian_achim_mueller-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e76ad3627be4f0dd2bdacbda879223cc0a14014b275fe30aa20d2113efd2abac |
|
MD5 | 30e19b002d120ddcf6da1e444991f135 |
|
BLAKE2b-256 | 1a9dd67b66b39b680853aa0a6041ce02e3115e855dd89420d3087a4822ab6bd2 |
Close
Hashes for json_utils_sebastian_achim_mueller-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88b9206837ee49b0c64364ae443d1a9eef2aa5b44d52404415442fc6c31fabe2 |
|
MD5 | aa5eca97f14804a940f7f54ed6d38f0f |
|
BLAKE2b-256 | bd5e024aed9037a8ee84d6dba6d15c51b66d42f3bade4d72a635ccc75d82c089 |