json
json.to_json
                                                                                
 Documentation                                                                  
                          Convert arbitrary types into json.                    
                                                                                
                          Very early days for this module, it doesn't support   
                          a lot of types yet.                                   
                                                                                
 Origin                                                                         
                          Authors   Markus Binsteiner (markus@frkl.io)          
                                                                                
 Context                                                                        
                          Tags         core                                     
                          Labels       package: kiara_modules.core              
                          References   source_repo:                             
                                       https://github.com/DHARPA-Project/kia…   
                                       documentation:                           
                                       https://dharpa.org/kiara_modules.core/   
                                       module_doc:                              
                                       https://dharpa.org/kiara_modules.core…   
                                       source_url:                              
                                       https://github.com/DHARPA-Project/kia…   
                                                                                
 Module config                                                                  
                          Field         Type     Description         Required   
                         ─────────────────────────────────────────────────────  
                          constants     object   Value constants     no         
                                                 for this module.               
                          defaults      object   Value defaults      no         
                                                 for this module.               
                          source_type   string   The source type.    yes        
                          target_type   string   The target type.    yes        
                                                                                
 Module config          -- no config --                                         
 Python class                                                                   
                          class_name    ToJsonModuleOld                         
                          module_name   kiara_modules.core.json                 
                          full_name     kiara_modules.core.json.ToJsonModule…   
                                                                                
 Processing source code  ─────────────────────────────────────────────────────  
                          def process(self, inputs: ValueSet, outputs: Value…   
                                                                                
                              value = inputs.get_value_obj("source_value")      
                              if value.value_schema.type != self.source_type:   
                                  raise KiaraProcessingException(               
                                      f"Can't convert value of source type '…   
                                  )                                             
                              config = inputs.get_value_data("config")          
                              if config is None:                                
                                  config = {}                                   
                                                                                
                              target_value = self.convert(value=value, confi…   
                              # TODO: validate value?                           
                              outputs.set_value("target_value", target_value)   
                                                                                
                         ─────────────────────────────────────────────────────