Category : json

I want to split the following, nested dictionary into different dictionaries by language. And create a new JSON file for each new dictionary. (meaning for each language) Afterwards I would like to merge them back together. Grateful for any suggestions how to continue! Example: { "All": { "label_es_ES": "Todo", "label_it_IT": "Tutto", "label_en_EN": "All", "label_fr_FR": "Tout" ..

Read more

I have a list of file names in the single file record.txt as format like this: /home/user/working/united.txt /home/user/working/temporary.txt /home/user/working/fruits.txt I have the only temporary.txt file in the json format like temporary.json in the other folder which I needed as json I want to create the all remaining files which are not in folder but present ..

Read more

data1.json [ { "country": "England" }, { "country": "USA" } ] data2.json "Comment": "all new record", "all_data": [ { "id":"1", "Type":"D" }, { "id":"2", "Action":"pass" }, { "id":"10", "custom_param": { "env.all_country": "fetch_country" } } ] Below Program I am using to load both files and then fetch_country name: with open(‘data1.json’) as item1, open(‘data2.json’) as item2: ..

Read more

I’ve generated the following schema, but once I try to validate (on jsonschemavalidator.net) I get an error: "Unexpected token encountered when reading value for ‘required’. Expected StartObject, got StartArray." The json schema is: { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "rioolwaterzuivering": { "type": "object", "properties": { "zandvanger": { "type": "object", "properties": { "kogelafsluiter": { "type": ..

Read more

So I am having here one big JSON file which looks like this: data = { "Module1": { "Description": "", "Layer": "1", "SourceDir": "pathModule1", "Attributes": { "some", }, "Vendor": "comp", "components":{ "Component1": { "path": "something", "includes": [ "include1", "include2", "include3", "include4", "include5" ] }, "Component2":{ "path": "something", "includes": [ "include1", "include2", "include3", "include4", "include5" ] ..

Read more

I have a text in json format: ‘{"Info":{"Result":"OK","ID":8840,"FamilyName":"book","Title":"A950","Model":"A-A","Name":"A 5","Img":"A950-A.png"}}’ how do I capture the "Img" field I’m trying to print(json.loads(response.text[‘Info’][‘Img’])) but I get an error: string indices must be integers Source: Python..

Read more