Atlan Python Client
Project description
๐ Project Stats
- ๐ Python Versions: 3.9, 3.10, 3.11, 3.12, 3.13
- ๐ฆ Package Size: Optimized for fast installation
- ๐ Performance: Built with modern async/await support
- ๐ง Dependencies: Minimal, modern stack
- ๐ Stability: Production-ready
๐ฆ Installation
Production Use
# Latest stable version
pip install pyatlan
# Specific version
pip install pyatlan==7.1.3
# With uv (faster) - install uv first: curl -LsSf https://astral.sh/uv/install.sh | sh
uv add pyatlan
Development Setup
# Clone the repository
git clone https://github.com/atlanhq/atlan-python.git
cd atlan-python
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install with development dependencies
uv sync --group dev
# Run quality checks
uv run ./qa-checks
# Run tests
uv run pytest tests/unit
Dependency Groups
This project uses uv dependency groups for better dependency management:
- Core dependencies: Always installed (
uv sync) - Development dependencies: Testing, linting, formatting (
uv sync --group dev) - Documentation dependencies: Sphinx docs (
uv sync --group docs)
You can install multiple groups:
# Install both dev and docs dependencies
uv sync --group dev --group docs
# Install all dependencies
uv sync --all-groups
๐ณ Docker
Pre-built Images
# Latest version
docker pull ghcr.io/atlanhq/atlan-python:latest
# Specific version
docker pull ghcr.io/atlanhq/atlan-python:7.1.3
Usage
# Interactive Python session
docker run -it --rm ghcr.io/atlanhq/atlan-python:latest
# Run a script
docker run -it --rm \
-v $(pwd):/app \
-e ATLAN_API_KEY=your_key \
-e ATLAN_BASE_URL=https://your-tenant.atlan.com \
ghcr.io/atlanhq/atlan-python:latest \
python your_script.py
๐งช Testing
Unit Tests
# Run all unit tests
uv run pytest tests/unit
# Run with coverage
uv run pytest tests/unit --cov=pyatlan --cov-report=html
Integration Tests
# Set up environment
cp .env.example .env
# Edit .env with your Atlan credentials
# Run integration tests
uv run pytest tests/integration
Quality Assurance
# Run all QA checks (formatting, linting, type checking)
uv run ./qa-checks
# Individual checks
uv run ruff format . # Code formatting
uv run ruff check . # Linting
uv run mypy . # Type checking
๐ค Contributing
We welcome contributions! Here's how to get started:
Development Setup
# Fork and clone the repository
git clone https://github.com/your-username/atlan-python.git
cd atlan-python
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install development dependencies
uv sync --group dev
# Install pre-commit hooks
uv run pre-commit install
Making Changes
# Create a feature branch
git checkout -b feature/amazing-feature
# Make your changes and test
uv run ./formatter
uv run ./qa-checks
uv run pytest tests/unit
# Commit with conventional commits
git commit -m "feat: add amazing feature"
# Push and create a pull request
git push origin feature/amazing-feature
Guidelines
- โ Follow conventional commits
- โ Add tests for new features
- โ Update documentation as needed
- โ Ensure all QA checks pass
๐ ๏ธ SDK Generator
Generate asset models from your Atlan instance:
# Generate models automatically
uv run ./generator
# Use custom typedefs file
uv run ./generator ./my-typedefs.json
This will:
- ๐ฅ Retrieve typedefs from your Atlan instance
- ๐๏ธ Generate asset models, enums, and structures
- ๐จ Format code automatically
- โก Support incremental updates
๐ Project Structure
Understanding the codebase layout will help you navigate and contribute effectively:
atlan-python/
โโโ pyatlan/ # ๐ Main Python package
โ โโโ __init__.py # Package initialization
โ โโโ cache/ # ๐พ Caching mechanisms
โ โ โโโ atlan_tag_cache.py # Tag name โ GUID mapping
โ โ โโโ custom_metadata_cache.py # Custom metadata definitions
โ โ โโโ enum_cache.py # Enum value caching
โ โ โโโ aio/ # Async versions of caches
โ โโโ client/ # ๐ HTTP client implementations
โ โ โโโ atlan.py # Main synchronous client
โ โ โโโ asset.py # Asset operations (CRUD, search)
โ โ โโโ admin.py # Administrative operations
โ โ โโโ audit.py # Audit log operations
โ โ โโโ common/ # Shared client logic
โ โ โโโ aio/ # Async client implementations
โ โโโ model/ # ๐ Data models and assets
โ โ โโโ assets/ # Asset type definitions
โ โ โ โโโ core/ # Core asset types (Table, Database, etc.)
โ โ โ โโโ relations/ # Relationship models
โ โ โโโ fields/ # Search field definitions
โ โ โโโ open_lineage/ # OpenLineage specification models
โ โ โโโ packages/ # Package/workflow models
โ โ โโโ aio/ # Async model variants
โ โโโ generator/ # ๐๏ธ Code generation tools
โ โ โโโ templates/ # Jinja2 templates for generation
โ โ โโโ class_generator.py # Main generation logic
โ โโโ pkg/ # ๐ฆ Package creation utilities
โ โโโ events/ # ๐ Event handling (webhooks, lambdas)
โ โโโ samples/ # ๐ก Example code and scripts
โ โโโ test_utils/ # ๐งช Testing utilities
โโโ tests/ # ๐งช Test suite
โ โโโ unit/ # Unit tests (fast, no external deps)
โ โโโ integration/ # Integration tests (require Atlan instance)
โ โโโ data/ # Test fixtures and mock data
โโโ docs/ # ๐ Sphinx documentation
โ โโโ conf.py # Sphinx configuration
โ โโโ *.rst # Documentation source files
โโโ pyproject.toml # ๐ Project configuration (deps, tools)
โโโ uv.lock # ๐ Locked dependencies
โโโ qa-checks # โ
Quality assurance script
โโโ formatter # ๐จ Code formatting script
โโโ generator # ๐๏ธ Model generation script
Key Components
๐ Client Layer (pyatlan/client/)
- Synchronous: Direct HTTP operations using
httpx - Asynchronous: Async/await operations using
httpx.AsyncClient - Common: Shared business logic between sync/async clients
- Specialized: Domain-specific clients (admin, audit, lineage, etc.)
๐ Model Layer (pyatlan/model/)
- Assets: 400+ asset types (tables, dashboards, pipelines, etc.)
- Core Models: Base classes, requests, responses
- Fields: Search and filtering field definitions
- OpenLineage: Data lineage specification compliance
๐พ Cache Layer (pyatlan/cache/)
- Tag Cache: Maps human-readable tag names to internal GUIDs
- Custom Metadata: Caches custom attribute definitions
- Connection Cache: Stores connector and connection metadata
- Async Variants: Full async implementations for all caches
๐๏ธ Generation System (pyatlan/generator/)
- Templates: Jinja2 templates for assets, enums, documentation
- Generator: Retrieves typedefs and generates Python models
- Incremental: Only regenerates changed models for efficiency
๐งช Testing Strategy
- Unit Tests: Fast, isolated tests with mocks/fixtures
- Integration Tests: Real API calls (requires credentials)
- VCR Cassettes: Record/replay HTTP interactions for consistent testing
๐ฆ Package System (pyatlan/pkg/)
- Custom Packages: Framework for building Atlan-deployable packages
- Templates: Pre-built package structures and configurations
- Utilities: Helper functions for package development
Development Workflow
- Models: Generated from your Atlan instance's typedefs
- Clients: Hand-crafted for optimal developer experience
- Tests: Mix of unit (fast iteration) and integration (real validation)
- Quality: Automated formatting, linting, and type checking
- Documentation: Auto-generated from docstrings and examples
๐ License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
๐ Attribution
Portions of this SDK are based on original work from:
- Apache Atlas (Apache-2.0 license)
- Elasticsearch DSL (Apache-2.0 license)
Built with ๐ by Atlan
Website โข Documentation โข Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyatlan-8.5.1.tar.gz.
File metadata
- Download URL: pyatlan-8.5.1.tar.gz
- Upload date:
- Size: 835.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7075a27ba51a98e8fc9d33e6038df002d5d96803a67c56d4daec79d611993fc
|
|
| MD5 |
301474d9b8df8694fe932924960ed2b3
|
|
| BLAKE2b-256 |
e4f3065b4717344d2021d3fe1cd11f081277ffb941bec525e40f51fd21150aa5
|
File details
Details for the file pyatlan-8.5.1-py3-none-any.whl.
File metadata
- Download URL: pyatlan-8.5.1-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17fd86a2995ccb509101a209b6534c426be07417bb9e39156f5fa814d7566639
|
|
| MD5 |
c172df45266ce044ba3ea805d3af2700
|
|
| BLAKE2b-256 |
117b58f909751475b69b6e12043a09c8b118bb27a6690d961bf08bc37c71c1cc
|