{"id":5388,"library":"pyapacheatlas","title":"PyApacheAtlas","description":"PyApacheAtlas is a Python package designed to simplify interaction with the Apache Atlas REST APIs, including Azure Purview. It provides clients for authentication, entity management, glossary operations, and Excel template parsing for bulk uploads. The library is actively maintained, with new minor versions released roughly every 1-2 months, incorporating features for the latest Apache Atlas and Azure Purview capabilities. The current version is 0.16.0.","status":"active","version":"0.16.0","language":"en","source_language":"en","source_url":"https://github.com/wjohnson/pyapacheatlas","tags":["azure","purview","apache-atlas","data-governance","metadata","catalog"],"install":[{"cmd":"pip install pyapacheatlas","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The main client for Purview operations is in the auth module, not core.","wrong":"from pyapacheatlas.core import PurviewClient","symbol":"PurviewClient","correct":"from pyapacheatlas.auth import PurviewClient"},{"symbol":"ExcelReader","correct":"from pyapacheatlas.readers import ExcelReader"},{"symbol":"AtlasEntity","correct":"from pyapacheatlas.core.atlas_entities import AtlasEntity"},{"note":"Entity and classification helpers are nested within atlas_entities.","wrong":"from pyapacheatlas.core import AtlasClassification","symbol":"AtlasClassification","correct":"from pyapacheatlas.core.atlas_entities import AtlasClassification"},{"note":"Required for Azure Purview authentication, part of `azure-identity`.","symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom pyapacheatlas.auth import PurviewClient\nfrom pyapacheatlas.core.atlas_entities import AtlasEntity\n\n# Replace with your Purview account name\npurview_account_name = os.environ.get(\"PURVIEW_NAME\", \"YOUR_PURVIEW_ACCOUNT_NAME\")\n\ntry:\n    # Authenticate using DefaultAzureCredential (ensure 'azure-identity' is installed)\n    credential = DefaultAzureCredential()\n    client = PurviewClient(\n        account_name=purview_account_name,\n        authentication=credential\n    )\n\n    # Example: Define a simple Atlas entity (e.g., a table)\n    table_entity = AtlasEntity(\n        name=\"my_example_table\",\n        typeName=\"azure_sql_table\",\n        qualifiedName=f\"mssql://{purview_account_name}/server/database/my_example_table\",\n        guid=\"-100\" # Use negative GUIDs for temporary entities in bulk uploads\n    )\n\n    # Example: Upload the entity to Purview\n    # For real use, ensure 'YOUR_PURVIEW_ACCOUNT_NAME' is replaced or PURVIEW_NAME env var is set\n    # response = client.upload_entities([table_entity])\n    # print(f\"Successfully uploaded entity: {response.json()}\")\n\n    # Example: Search for entities (using the recommended discover method)\n    search_results = client.discover.search_entities(query=\"my_example_table\")\n    print(f\"Search results (first 5): {search_results.json().get('value', [])[:5]}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure 'PURVIEW_NAME' environment variable is set or replace 'YOUR_PURVIEW_ACCOUNT_NAME'.\")\n    print(\"Also ensure your Azure AD account has permissions to the Purview account.\")","lang":"python","description":"This quickstart demonstrates how to initialize the `PurviewClient` using `DefaultAzureCredential` for Azure Purview authentication, define a simple `AtlasEntity`, and perform a search using the `discover` API. Remember to set the `PURVIEW_NAME` environment variable or replace the placeholder."},"warnings":[{"fix":"Replace calls to `client.search_entities(...)` with `client.discover.search_entities(...)`.","message":"The `PurviewClient.search_entities` method was deprecated and moved. Users should now use `PurviewClient.discover.search_entities`.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Review the latest Excel template documentation for the recommended lineage types and adapt your templates accordingly. Use more generic `AtlasProcess` with relationships where applicable.","message":"The `TablesLineage` and `FineGrainColumnLineage` entity types were deprecated from the Excel bulk upload template. Attempting to use these types might lead to errors or unexpected behavior.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Always refer to the official Apache Atlas or Azure Purview API documentation for correct entity structures. Utilize the `AtlasEntity` helper classes and ensure 'typeName' and 'qualifiedName' are accurate and unique for your environment.","message":"PyApacheAtlas heavily relies on dictionary structures and specific 'typeName' and 'qualifiedName' conventions for Atlas entities. Incorrectly formatted entities are a common source of API errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}