Classes | Functions | Variables
nova_caf_metadata Namespace Reference

Classes

class  NovaCAFExtractor
 

Functions

def hasJson (jStr)
 
def loads_recursive (jStr)
 

Variables

 novaCAFExtractor = NovaCAFExtractor()
 

Function Documentation

def nova_caf_metadata.hasJson (   jStr)

Definition at line 13 of file nova_caf_metadata.py.

Referenced by loads_recursive().

13 def hasJson(jStr):
14  return "{" in jStr or "[" in jStr
15 
def nova_caf_metadata.loads_recursive (   jStr)

Definition at line 16 of file nova_caf_metadata.py.

References hasJson(), and runNovaSAM.str.

Referenced by nova_caf_metadata.NovaCAFExtractor._createMetadata().

16 def loads_recursive(jStr):
17  j = json.loads(str(jStr))
18  try:
19  # If this works, it's a dict
20  return { key:(loads_recursive(value) if hasJson(value) else value) for key, value in j.items() }
21  except:
22  # Otherwise it's a list
23  return [loads_recursive(item) if hasJson(item) else item for item in j]
24 
25 
26 

Variable Documentation

nova_caf_metadata.novaCAFExtractor = NovaCAFExtractor()

Definition at line 52 of file nova_caf_metadata.py.