No project description provided
Project description
Json Straw
A simple library to read massive JSON files.
What is it for?
Working with large JSON files is hard. It normally requires you to load the entire file into memory and use the json library to parse it. The problem is that loading the whole file is a challenge with very large JSON.
To solve this problem jsonstraw will read the file line by line, parse a number of objects and return them as an iterator.
Example
Image we need to parse a large file like this:
{
"data": [
{
"name": "Bob",
"id": 0,
"role": "user"
},
{
"name": "Sue",
"id": 1,
"role": "user"
},
{
"name": "Alan",
"id": 2,
"role": "user"
}
// plus 10,000,000 more
]
}
We have a large JSON document with a list of data that we need to parse.
from jsonstraw import read_json_chunk
for output in read_json_chunk("large_file.json", key = 'data', chunk_size=1000):
assert len(output) == 1000
We can use an iterator to read the JSON file. It will parse each object, convert it to a dict and provide lists based on your chunk_size.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsonstraw-0.1.0.tar.gz.
File metadata
- Download URL: jsonstraw-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebc1d92ca27a687d5f8552ea5e7229af3de43d7e4a09292dfee7667e66a243db
|
|
| MD5 |
4e669847be196335cc4f50ff3963cf6e
|
|
| BLAKE2b-256 |
103961ba5bd62b605510472f991e807c2f231c0f0c4160cfa35b1326ac7b8c61
|
Provenance
The following attestation bundles were made for jsonstraw-0.1.0.tar.gz:
Publisher:
tag.yml on Loqui-Tech/jsonstraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsonstraw-0.1.0.tar.gz -
Subject digest:
ebc1d92ca27a687d5f8552ea5e7229af3de43d7e4a09292dfee7667e66a243db - Sigstore transparency entry: 200590114
- Sigstore integration time:
-
Permalink:
Loqui-Tech/jsonstraw@0f72f2630aa8da1a384835d27945be99f6674422 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/Loqui-Tech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tag.yml@0f72f2630aa8da1a384835d27945be99f6674422 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jsonstraw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jsonstraw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b8abdf5d5df7dab8a190afb0d324640c68e8dc1daa9ef896e9976e18c2cfa88
|
|
| MD5 |
0a9ef444591731ea1159c6c32f655f42
|
|
| BLAKE2b-256 |
3d03390910795fc1ab9a28b0c64a13a5813e007cb3d11bb796d660629c5b1ada
|
Provenance
The following attestation bundles were made for jsonstraw-0.1.0-py3-none-any.whl:
Publisher:
tag.yml on Loqui-Tech/jsonstraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsonstraw-0.1.0-py3-none-any.whl -
Subject digest:
9b8abdf5d5df7dab8a190afb0d324640c68e8dc1daa9ef896e9976e18c2cfa88 - Sigstore transparency entry: 200590115
- Sigstore integration time:
-
Permalink:
Loqui-Tech/jsonstraw@0f72f2630aa8da1a384835d27945be99f6674422 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/Loqui-Tech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tag.yml@0f72f2630aa8da1a384835d27945be99f6674422 -
Trigger Event:
release
-
Statement type: