Registry / database / pyapacheatlas

pyapacheatlas

JSON →
library0.16.0pypypi✓ verified 24d ago

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.

pip install pyapacheatlas
INSTALL
IMPORT
SIG · PYAPACHEATLAS
P
pyapacheatlas
databasepythonv0.16.0
Install
2.5s avg
Import
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.16.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PurviewClient
from pyapacheatlas.auth import PurviewClient
from pyapacheatlas.auth import PurviewClient

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.

import os from azure.identity import DefaultAzureCredential from pyapacheatlas.auth import PurviewClient from pyapacheatlas.core.atlas_entities import AtlasEntity # Replace with your Purview account name purview_account_name = os.environ.get("PURVIEW_NAME", "YOUR_PURVIEW_ACCOUNT_NAME") try: # Authenticate using DefaultAzureCredential (ensure 'azure-identity' is installed) credential = DefaultAzureCredential() client = PurviewClient( account_name=purview_account_name, authentication=credential ) # Example: Define a simple Atlas entity (e.g., a table) table_entity = AtlasEntity( name="my_example_table", typeName="azure_sql_table", qualifiedName=f"mssql://{purview_account_name}/server/database/my_example_table", guid="-100" # Use negative GUIDs for temporary entities in bulk uploads ) # Example: Upload the entity to Purview # For real use, ensure 'YOUR_PURVIEW_ACCOUNT_NAME' is replaced or PURVIEW_NAME env var is set # response = client.upload_entities([table_entity]) # print(f"Successfully uploaded entity: {response.json()}") # Example: Search for entities (using the recommended discover method) search_results = client.discover.search_entities(query="my_example_table") print(f"Search results (first 5): {search_results.json().get('value', [])[:5]}") except Exception as e: print(f"An error occurred: {e}") print("Ensure 'PURVIEW_NAME' environment variable is set or replace 'YOUR_PURVIEW_ACCOUNT_NAME'.") print("Also ensure your Azure AD account has permissions to the Purview account.")
Debug
Known issues
breakingThe `PurviewClient.search_entities` method was deprecated and moved. Users should now use `PurviewClient.discover.search_entities`.
fix
Replace calls to `client.search_entities(...)` with `client.discover.search_entities(...)`.
affects: >=0.10.0
breakingThe `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.
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.
affects: >=0.11.0
gotchaPyApacheAtlas heavily relies on dictionary structures and specific 'typeName' and 'qualifiedName' conventions for Atlas entities. Incorrectly formatted entities are a common source of API errors.
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.
affects: All versions
Upgrade
Version history
0.16.0latest on PyPI · released Dec 23, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
Amazon
1
Resources
pyapacheatlas — pip install pyapacheatlas · libregistry