Source code for node_import_json
# This file is part of Sympathy for Data.
# Copyright (c) 2018, Combine Control Systems AB
#
# SYMPATHY FOR DATA COMMERCIAL LICENSE
# You should have received a link to the License with Sympathy for Data.
from sylib.importer import base
from sympathy.api import node as synode
from sympathy.api.nodeconfig import Port, Ports, Tag, Tags
from sympathy.api import importers
[docs]
class ImportJson(base.ImportSingle, synode.Node):
__doc__ = """
Import a Json or XML file to a Json structure.
If ``Importer to use`` is set to ``auto`` the program will try to guess if
it is an XML or JSON file, based on the file extension and the content of
the first line of the file.
""" + base.URL_DOC
author = 'Samuel Genheden'
icon = 'json.svg'
tags = Tags(Tag.Input.Import)
name = 'Json'
nodeid = 'org.sysess.sympathy.data.json.importjson'
plugins = (importers.JsonDataImporterBase, )
outputs = Ports([Port.Json('Imported Json', name='port1')])
[docs]
class ImportJsons(base.ImportMulti, synode.Node):
__doc__ = """
Import multiple Json or XML files to multiple Json objects.
""" + base.URL_DOC
author = 'Samuel Genheden'
icon = 'json.svg'
tags = Tags(Tag.Input.Import)
name = 'Jsons'
nodeid = 'org.sysess.sympathy.data.json.importjsons'
plugins = (importers.JsonDataImporterBase, )
outputs = Ports([Port.Jsons('Imported Jsons', name='port1')])