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
File details
Details for the file json_utils_sebastian_achim_mueller-0.0.5.tar.gz
.
File metadata
- Download URL: json_utils_sebastian_achim_mueller-0.0.5.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e76ad3627be4f0dd2bdacbda879223cc0a14014b275fe30aa20d2113efd2abac |
|
MD5 | 30e19b002d120ddcf6da1e444991f135 |
|
BLAKE2b-256 | 1a9dd67b66b39b680853aa0a6041ce02e3115e855dd89420d3087a4822ab6bd2 |
File details
Details for the file json_utils_sebastian_achim_mueller-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: json_utils_sebastian_achim_mueller-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88b9206837ee49b0c64364ae443d1a9eef2aa5b44d52404415442fc6c31fabe2 |
|
MD5 | aa5eca97f14804a940f7f54ed6d38f0f |
|
BLAKE2b-256 | bd5e024aed9037a8ee84d6dba6d15c51b66d42f3bade4d72a635ccc75d82c089 |