Questions tagged [ijson]

Ijson is an iterative JSON parser with standard Python iterator interfaces.

Links

66 questions
0
votes
1 answer

Exploding a large json-file using ijson

I have a large json-file (too large to fit in memory) with the following structure: { "commonVal": "foo", "entries": [ { "bar": "baz1" }, { "bar": "baz2" }, ..., ] } I would like to process this json file as…
aioobe
  • 413,195
  • 112
  • 811
  • 826
0
votes
1 answer

ValueError: Comments are not supported by the python backend

The ijson module has a documented option allow_comments=True, but when I include it, an error message is produced: ValueError: Comments are not supported by the python backend Below is a transcript using the file test.py: import ijson for o in…
peak
  • 105,803
  • 17
  • 152
  • 177
0
votes
1 answer

Exception when trying to parse large JSON file using ijson

I am trying to parse a large JSON file (16GB) using ijson but I always get the following error : Exception has occurred: IncompleteJSONError lexical error: invalid char in json text. venue" : { "type" : NumberInt(0) }, …
red ben
  • 13
  • 3
0
votes
0 answers

Python - Parse JSON file using ijson

I am having json file which around 600MB. The structure of the json file is, [ { "metadata":{ "batchSize":100, "totalRecords":"1000", "batchIndex":1 }, "notificationData":[ { …
vishal
  • 309
  • 3
  • 6
  • 21
0
votes
0 answers

Can we do Parallel Streaming, with IJSON for bulky JSON data Parsing/processing

I am aware how IJSON is solving, the bulky JSON reading and processing challenges. However i am not able to find any article which specifies how to speed up this: I have seen few things to achieve that 1. Use YAZL backend 2. Play with buff_size…
Shubham Chauhan
  • 119
  • 2
  • 14
0
votes
1 answer

Reading JSON file from url using ijson

This is the code that I have been trying: import ijson import urllib.request with urllib.request.urlopen(some_link) as read_file: path_array = ijson.items(read_file, object_in_json) but I get this error: (b'lexical error: invalid char in…
sanford
  • 13
  • 2
0
votes
1 answer

Process is coming out of for loop for IJson Iteams

I am using python 3.9 and trying : with open(file, 'r') as fl: val = ijson.items(fl, '.item', use_float=True) for i in val: print(i) After some time print statement is not printing anything on jupyter console, but that…
Shubham Chauhan
  • 119
  • 2
  • 14
0
votes
1 answer

Parse big JSON file with font-encoding cp1252

I have to handle a big JSON file (approx. 47GB) and it seems as if I found the solution in ijson. However, when I want to go through the objects I get the following error: byggesag = (o for o in objects if o["h�ndelse"] == 'Byggesag') …
TomGeo
  • 1,213
  • 2
  • 12
  • 24
0
votes
1 answer

Using ijon package to read big json file (http.client.IncompleteRead error)

I'm trying to read a big json file (>1,5Gb), using ijson package and deal with the results. response = requests.get("https://api.scryfall.com/bulk-data/all-cards") with urlopen(response.json()["download_uri"]) as all_cards: for…
Benjamin
  • 65
  • 1
  • 8
0
votes
2 answers

python ijson not working on multiple element at once

I have thousands of very large JSON files that I need to process on specific elements. To avoid memory overload I am using a python library called ijson which works fine when I am processing only a single element from the json file but when I try to…
A l w a y s S u n n y
  • 36,497
  • 8
  • 60
  • 103
0
votes
1 answer

Python ijson - parse error: trailing garbage // bz2.decompress()

I have come across an error while parsing json with ijson. Background: I have a series(approx - 1000) of large files of twitter data that are compressed in a '.bz2' format. I need to get elements from the file into a pd.DataFrame for further…
James
  • 15
  • 4
0
votes
0 answers

Garbage values while reading large JSON files

I have to read a large json file of size 3 Gb using python.There is a garbage value '][' between the data in the json files.For files with small volume,I used the below script to trim the garbage…
Sandeep G
  • 13
  • 1
  • 4
0
votes
1 answer

How Can I Access All of The Keys in a JSON File Using IJSON kvitems?

I'm using ijson.kvitems to iterate over all of the keys in a JSON file that I have. the JSON file looks like this: {"filename":{"file_data": {"name":"samplefile", "filetype":"Miscellaneous", "id":123, "timestamp":"2020-10-08 00:20:00"}}} based on…
Haminator
  • 11
  • 1
0
votes
1 answer

How can i use ijson to extract a set of corresponding data from json file?

I have a json file just like this: { "CVE_data_type" : "CVE", "CVE_Items" : [ { "cve" : { "CVE_data_meta" : { "ID" : "CVE-2020-0001", "ASSIGNER" : "security@android.com" }, ... …
brian.liu
  • 13
  • 2
0
votes
2 answers

Adding commas in between JSON objects while writing,

I am parsing an extremely large JSON file using IJSON and then writing the contents to a temp file. Afterwards, I overwrite the original file with the contents of the temp file. FILE_NAME = 'file-name' DIR_PATH = 'path' #Generator function that…
aziz-ashy
  • 35
  • 1
  • 6