Apache Atlas Client (jpoullet2000)

1.0.0 · maintenance · verified Sat Apr 11

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

Install

Imports

Quickstart

Initializes the `Atlas` client and performs a basic attribute-based search for 'DataSet' entities. Ensure `ATLAS_HOST`, `ATLAS_PORT`, `ATLAS_USERNAME`, and `ATLAS_PASSWORD` environment variables are set or replaced with actual values. The default port for HTTP is 21000, and for HTTPS is 21443.

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}")

view raw JSON →