Questions tagged [ndjson]

NDJSON is a newline delimited JSON format.

NDJSON is a newline delimited JSON format. It is a convenient format for storing or streaming structured data that may be processed one record at a time. It works well with unix-style text processing tools and shell pipelines. It's a great format for log files. It's also a flexible format for passing messages between cooperating processes.

Spec: http://ndjson.org

119 questions
0
votes
0 answers

How do I automate file creation as a result of response.content output from a POST/GET request in Python. I DONT want to use a file already created

response = requests.post(url, json=dict_element, headers=headers, verify=False) with open("backup_output.txt", "wb") as f: for dict_element in json_dict: f.write(response.content) print(response.content) This is an…
0
votes
0 answers

How to convert json to ndjson using jf?

I wish to convert this JSON {"key1": {"a":1}, "key2": {"a":2}} to NDJSON: {"key":"key1", "a":1} {"key":"key2", "a":2} I could easily write python myself. But, how do I do this with jf?
dfrankow
  • 20,191
  • 41
  • 152
  • 214
0
votes
1 answer

How to get an unknown substring between two known substrings, within a giant string/file

I'm trying to get all the substrings under a "customLabel" tag, for example "Month" inside of ...,"customLabel":"Month"},"schema":"metric... Unusual issue: this is a 1071552 characters long ndjson file, of a single line ("for line in file:" is…
Ipatchy.M
  • 3
  • 3
0
votes
0 answers

How can I upload a NDJSON file into postgresql?

I wonder how to import a Newline Delimited JSON file into pg Admin4?
Reve
  • 11
  • 2
0
votes
1 answer

Angular HttpClient GET parsing error for application/x-ndjson

I am trying to consume a Spring boot webfulx reactive api in my angular but I am getting below error in browser developer console. {error: SyntaxError: Unexpected token { in JSON at position 231 at JSON.parse The api produces application/x-ndjson…
0
votes
0 answers

How to make a Post request by pushing ND-JSON file using RestSharp?

I'm trying to get the RestSharp (v107) equivalent of the following cURL command: curl --insecure -H "Content-Type: application/x-ndjson" -XPOST -u user:password https://localhost:9200/products/_bulk --data-binary…
Vignesh
  • 35
  • 4
0
votes
2 answers

How to open HTTP stream on iOS using ndjson

Does anyone have experience opening HTTP stream on iOS? I have tried multiple solutions without any luck (examples bellow). For better context, here's example of endpoint that will stream values (as ndjson) upon opening connection: GET…
Lachtan
  • 4,803
  • 6
  • 28
  • 34
0
votes
1 answer

R jsonlite stream_in losing precision

I am reading in ndjson file (~1Gb) with large IDs. The IDs are around 19 digits and lose precision when streamed in. The last 4-5 digits differ. How can I avoid this? Thank you! library(jsonlite) data_out <- data.frame(userID =…
qwertzuiop
  • 172
  • 8
0
votes
0 answers

How do I get my response to show ndjson data instead of text?

My API call returns an ndjson format that wont allow me to use "data = response.json". My only work around is doing this. This give me a string format that is difficult to parse. After put into a pandas df, it is about 20 columns of dictionaries of…
user17629522
  • 105
  • 8
0
votes
2 answers

Updating value in file of json objects in python

I have a file, and each line of the file is a json object. For example: {name:value1,city:value2} {name:value3,city:value4} etc. What I am trying to do is run a line-by-line search on the file. If the value is equal to the searched parameter,…
tzvik15
  • 123
  • 1
  • 11
0
votes
1 answer

How to iterate through all columns in pandas df using pd.json_normalize()?

I have a pandas df that looks like this but has 20 columns. I am wanting to write a loop that iterates through all of the columns and normalizes them. I have trouble understanding loops. b = json_data b1 = pd.json_normalize(b['financial']) for…
user17629522
  • 105
  • 8
0
votes
1 answer

Python loop through ndjson file data

I have ndjson file…
U B
  • 15
  • 8
0
votes
2 answers

How do I convert this column into multiple columns?

My pandas DataFrame looks like this: id address 1 [{'city': 'MURFREESBORO', 'line': ['9999 Candy Cane Island'], 'postalCode': '39999', 'state': '56'}] 2 [{'city': 'LIKELAND', 'line': ['11111 WS 80RD ST'], 'postalCode': '71398', 'state':…
user17629522
  • 105
  • 8
0
votes
1 answer

What are some ways I can structure this Semi-Structured dataframe from ndjson format?

(This is not real data) I requested similar data from a Rest API. Then, I was able to convert some of the data to a .ndJSON format ( lines = True ); however, the address column is still shown in the ndjson format structure similar to a Python…
user17629522
  • 105
  • 8
0
votes
0 answers

Ingest Json data into Elastic Search using filebeat

I attempted to import data from a json file into elastic search, but my filebeat had a configuration issue in filebeat.yml or an issue with the input Because my json is regular json, but filebeat only supports ndjson, Filebeat.yml …
max
  • 255
  • 2
  • 7