Have added a method named Spark as it is like the Spark Convention.This is similar to the Parker method except that this method takes and extra list parameter 'single_element_array_tags'. Specified tags in this list are formatted in the json as single element arrays if there is only one child.
After importing the required modules we can call this method as:
formatted_json = dumps(spark.data(fromstring(''), preserve_root=True, single_element_array_tags=['<tag 1>','<tag 2>']), sort_keys=True, indent=4)
Have added a method named Spark as it is like the Spark Convention.This is similar to the Parker method except that this method takes and extra list parameter 'single_element_array_tags'. Specified tags in this list are formatted in the json as single element arrays if there is only one child. After importing the required modules we can call this method as: formatted_json = dumps(spark.data(fromstring(''), preserve_root=True, single_element_array_tags=['<tag 1>','<tag 2>']), sort_keys=True, indent=4)