Hi, is it possible to get a kedro viz diagram from...
# questions
c
Hi, is it possible to get a kedro viz diagram from a pipeline defined in a script (no kedro project folder structure)? I mean that I'm using kedro while creating a Class that defines everything within itself (here some example code picked from different methods):
Copy code
self.catalog = kedro.io.DataCatalog()
self.pipeline = [function that defines the list of nodes]
self.runner = kedro.runner.SequentialRunner()

intermediate_outputs = set(self.pipeline.all_outputs()) - set(self.pipeline.outputs())
for output in intermediate_outputs:
    self.catalog.add(output, MemoryDataset(copy_mode="assign"))
self.catalog.add("input_data", MemoryDataset(model_input, copy_mode="assign"))

predictions = self.runner.run(
            pipeline=self.pipeline,
            catalog=self.catalog,
        )
So I have this Python Object in memory and I would like to create a diagram visualization of the pipeline.
🔥 1
j
Hi Claire, Thank you for your question. Currently, Kedro-viz doesn't support this functionality, but you can request it on GitHub. If it gets enough upvotes, we may consider building it in the future.
🙌 1
j
n
https://nbviewer.org/github/noklam/kedro-viz-lite/blob/main/nbs/10_demo.ipynb I did this a while ago as an attempt to run viz with in memory object. I didn't get the webserver to run successfully (I don't think it's hard, I just didn't have time to continue at the time). I did manage to produce a JSON file out of a in memory catalog/pipeline, from there you can just load the JSON with the usual kedro-viz command.
🙌 1