{"id":6044,"library":"pyatlan","title":"Atlan Python Client","description":"The `pyatlan` library is the official Python SDK for interacting with Atlan, a data governance and metadata management platform. It provides typed wrappers around the Atlan REST API, enabling users to programmatically search, discover, govern, and manage various data assets like tables, dashboards, and glossary terms. The current version, 9.4.0, includes experimental features for the next-generation `pyatlan_v9` and ongoing quality-of-life improvements. The library maintains an active release cadence with frequent updates.","status":"active","version":"9.4.0","language":"en","source_language":"en","source_url":"https://github.com/atlanhq/atlan-python","tags":["atlan","data governance","metadata management","data catalog","etl","data lineage"],"install":[{"cmd":"pip install pyatlan","lang":"bash","label":"Install latest stable version"}],"dependencies":[{"reason":"Required runtime version.","package":"python","max_version":"3.13","min_version":"3.9"},{"reason":"HTTP client for API communication.","package":"httpx","optional":false},{"reason":"Data validation, specifically Pydantic v2 models are now used. Older versions (pre-9.0.0) used Pydantic v1, which was replaced.","package":"pydantic","optional":false},{"reason":"Authentication utilities.","package":"authlib","optional":false},{"reason":"Used for faster serialization/deserialization in `pyatlan_v9` (from v9.0.0 onwards), replacing Pydantic v1 for core data layer models.","package":"msgspec","optional":false}],"imports":[{"symbol":"AtlanClient","correct":"from pyatlan.client import AtlanClient"},{"note":"For asynchronous operations.","symbol":"AsyncAtlanClient","correct":"from pyatlan.client.aio import AsyncAtlanClient"},{"symbol":"FluentSearch","correct":"from pyatlan.model.fluent_search import FluentSearch"},{"note":"Example asset type, many others available under `pyatlan.model.assets`.","symbol":"Table","correct":"from pyatlan.model.assets import Table"}],"quickstart":{"code":"import os\nfrom pyatlan.client import AtlanClient\nfrom pyatlan.model.fluent_search import FluentSearch\nfrom pyatlan.model.assets import Table\n\n# Configure with environment variables (recommended) or direct parameters\nATLAN_BASE_URL = os.environ.get('ATLAN_BASE_URL', 'https://<your-tenant>.atlan.com')\nATLAN_API_KEY = os.environ.get('ATLAN_API_KEY', 'YOUR_API_KEY') # Assign persona(s) to API token for access\n\nif not ATLAN_API_KEY or 'YOUR_API_KEY' in ATLAN_API_KEY:\n    raise ValueError(\"Please set ATLAN_API_KEY environment variable or replace 'YOUR_API_KEY' with your actual key.\")\nif not ATLAN_BASE_URL or '<your-tenant>' in ATLAN_BASE_URL:\n    raise ValueError(\"Please set ATLAN_BASE_URL environment variable or replace '<your-tenant>.atlan.com' with your actual Atlan URL.\")\n\ntry:\n    client = AtlanClient(base_url=ATLAN_BASE_URL, api_key=ATLAN_API_KEY)\n    \n    # Example: Search for active Table assets\n    search_request = (\n        FluentSearch()\n        .where(FluentSearch.asset_type(Table))\n        .where(FluentSearch.active_assets())\n        .page_size(10)\n        .to_request()\n    )\n    response = client.asset.search(search_request)\n\n    print(f\"Found {len(response.assets)} active Tables:\")\n    for asset in response.assets:\n        print(f\"  - {asset.name} ({asset.qualified_name})\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"Initializes the `AtlanClient` using API key authentication (preferably from environment variables) and performs a basic search for active Table assets."},"warnings":[{"fix":"Review and update code interacting with Atlan models, especially for serialization/deserialization. While functional parity is intended, direct Pydantic v1 model usage may require adaptation. Refer to `pyatlan_v9` documentation for migration guidance.","message":"Major architectural shift in version 9.0.0, where the core data layer models transitioned from Pydantic v1 to `msgspec` for improved performance. This is part of the experimental `pyatlan_v9` initiative.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Upgrade to `pyatlan` version 9.3.2 or later, which revised the logic to correctly distinguish between retried creations and legitimate update requests, allowing updates to proceed.","message":"In versions 9.2.0 through 9.3.1, the policy duplicate detection logic could inadvertently block legitimate policy *updates*, treating them as duplicate creations.","severity":"gotcha","affected_versions":"9.2.0 - 9.3.1"},{"fix":"Upgrade to `pyatlan` version 9.3.0 or later, which reordered the `Union` type to prioritize `int` over `str`, resolving the deserialization issue.","message":"In versions prior to 9.3.0, the `DQCondition.value` field's `Union` type ordering could incorrectly coerce integer values to strings during deserialization, leading to data type mismatches.","severity":"gotcha","affected_versions":"<9.3.0"},{"fix":"Always use environment variables (e.g., `ATLAN_API_KEY`, `ATLAN_BASE_URL`) for credentials. Ensure your logging configuration strips sensitive information from logs.","message":"Directly embedding API keys or other sensitive credentials in code is a security risk. API keys should never appear in logs or exception tracebacks.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}