Add to JSON

Add items into a JSON object.

Arguments

Argument Type Default value Description
doc typing.Anyjson as a dictionary object
expr strjsonpath expression
value strlist to append into json or dictionary to update into json
param doc:json as a dictionary object
param expr:jsonpath expression
param value:list to append into json or dictionary to update into json
return:json as a dictionary object

Convert JSON to String

Convert JSON object to a string.

Arguments

Argument Type Default value Description
doc typing.Anyjson as a dictionary object
param doc:json as a dictionary object
return:json as a string

Convert String to JSON

Convert a string to a JSON object.

Arguments

Argument Type Default value Description
doc strjson string
param doc:json string
return:json as a dictionary object

Delete from JSON

Delete item from a JSON object.

Arguments

Argument Type Default value Description
doc typing.Anyjson as a dictionary object or a string
expr strjsonpath expression
param doc:json as a dictionary object or a string
param expr:jsonpath expression
return:json as a dictionary object

Get value from JSON

Get a value from a JSON object.

Arguments

Argument Type Default value Description
doc typing.Anyjson as a dictionary object or a string
expr strjsonpath expression
param doc:json as a dictionary object or a string
param expr:jsonpath expression
raises ValueError:
 if expression matches more than one item
return:matching item

Get values from JSON

Get values from a JSON object.

Arguments

Argument Type Default value Description
doc typing.Anyjson as a dictionary object or a string
expr strjsonpath expression
param doc:json as a dictionary object or a string
param expr:jsonpath expression
return:list of matching values

Load JSON from file

Load JSON data from a file.

Arguments

Argument Type Default value Description
filename strpath to file
param filename:path to file
return:json as a dictionary object

Save JSON to file

Save JSON object into a file.

Arguments

Argument Type Default value Description
doc typing.Anyjson as a dictionary object or a string
filename strpath to file
param doc:json as a dictionary object or a string
param filename:path to file

Update value to JSON

Update value in a JSON object.

Arguments

Argument Type Default value Description
doc typing.Anyjson as a dictionary object or a string
expr strjsonpath expression
value strnew value for the matching item
param doc:json as a dictionary object or a string
param expr:jsonpath expression
param value:new value for the matching item
return:json as a dictionary object