from pyapacheatlas.auth import ServicePrincipalAuthentication from pyapacheatlas.core import PurviewClient class Purview: def __init__(self, account_name, file_name): self.file_name = file_name self.account_name = account_name account = Purview("Purview Client", "") #name provided when creating purview def upload(): # Service authentication PGN auth = ServicePrincipalAuthentication( tenant_id = "", #tenant of Purview client_id = "", #user wit haccess to Purview client_secret = "" #client secret value ) # Create a client to connect to your service. client = PurviewClient( account_name = account.account_name, authentication = auth ) # Upload excel from pyapacheatlas.readers import ExcelConfiguration, ExcelReader ec = ExcelConfiguration() reader = ExcelReader(ec) #load assets enteties = reader.parse_bulk_entities(str(account.file_name)) results = client.upload_entities(enteties) #load typedefinitions types = reader.parse_entity_defs(str(account.file_name)) client.upload_typedefs(types, force_update = True) #load lineage with maping processes = reader.parse_update_lineage_with_mappings(str(account.file_name)) results = client.upload_entities(processes)