Skip to content

Import json file as custom component with python #5800

Closed Answered by viniciossilva3
Tuguldur-Tserenbaljir asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Tuguldur-Tserenbaljir! Yes, it is possible, you can test it as in the example below!
The code is functional, but be very careful with the component structure settings, if you modify them, problems may occur such as the component appearing empty or other problems.

output.mp4

import requests
import json
from datetime import datetime
from typing import Optional, Dict, Any
from uuid import uuid4


def extract_component_info(component_data: dict) -> tuple[Optional[dict], Optional[str], Optional[dict]]:
    """
    Extract component information from the JSON data
    
    Args:
        component_data (dict): The component JSON data
        
    Returns:
        tuple: (component_n…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Tuguldur-Tserenbaljir
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants