Apache Atlas Client (jpoullet2000)
The `atlasclient` library by `jpoullet2000` provides a Python client for interacting with Apache Atlas, specifically designed for REST API v2. It offers functionality for discovery, entity management, and saved searches. The current version is 1.0.0, released in August 2019. While stable, this specific client is not actively developed; users seeking the latest features and ongoing maintenance should consider the official `apache-atlas` library.
Warnings
- gotcha This `atlasclient` library by `jpoullet2000` is only compatible with Apache Atlas REST API v2. It does not support newer API versions.
- deprecated The `jpoullet2000/atlasclient` library has not seen active development or new releases since 2019 (version 1.0.0). For new projects or ongoing maintenance, it is highly recommended to use the official and more actively maintained `apache-atlas` library (`pip install apache-atlas`).
- gotcha The PyPI listing for `atlasclient` by `jpoullet2000` shows its Development Status as '2 - Pre-Alpha' despite being version '1.0.0'. This conflicting information might suggest it's not considered production-ready by its maintainers or that the status was not updated correctly.
- gotcha Connection details (host, port, username, password) are crucial for client initialization. Default port 21000 is for HTTP, 21443 for HTTPS. Incorrect credentials or host can lead to connection failures.
Install
-
pip install atlasclient
Imports
- Atlas
from atlasclient.client import Atlas
Quickstart
import os
from atlasclient.client import Atlas
# Replace with your Atlas host, port, username, and password
ATLAS_HOST = os.environ.get('ATLAS_HOST', 'localhost')
ATLAS_PORT = int(os.environ.get('ATLAS_PORT', '21000')) # Default HTTP port
ATLAS_USERNAME = os.environ.get('ATLAS_USERNAME', 'admin')
ATLAS_PASSWORD = os.environ.get('ATLAS_PASSWORD', 'admin')
try:
client = Atlas(ATLAS_HOST, port=ATLAS_PORT, username=ATLAS_USERNAME, password=ATLAS_PASSWORD)
print(f"Successfully connected to Atlas at {ATLAS_HOST}:{ATLAS_PORT}")
# Example: Search for entities (e.g., of type 'DataSet')
params = {'typeName': 'DataSet', 'attrName': 'name', 'attrValue': 'data', 'offset': '0', 'limit': '10'}
search_results = client.search_attribute(**params)
if search_results:
print(f"Found {len(search_results[0].entities)} 'DataSet' entities matching criteria:")
for s in search_results:
for e in s.entities:
print(f" Name: {e.name}, GUID: {e.guid}")
else:
print("No 'DataSet' entities found matching criteria.")
except Exception as e:
print(f"Error connecting to Atlas or performing search: {e}")