Skip to main content
Get started with the Elementary Python SDK in minutes. This guide shows you how to define data quality tests using decorators and automatically report them to Elementary Cloud.

Step 1: Install the SDK

Step 2: Import Required Modules

Step 3: Define Your Tests Using Decorators

The SDK provides decorators to define tests. Here are examples:

Step 4: Create Your Data Asset

Step 5: Run Tests and Send Results

Complete Example

Here’s the complete example from the Elementary blog post:
Note:
  • Replace API_KEY and URL with your actual credentials. The URL should be the full SDK ingest endpoint including your environment ID.
  • PROJECT_ID is your Python project identifier - choose any string to identify your code project. This will appear in the metadata of assets you report and is used for deduplication.

What Happens Next?

Once you send test results to Elementary Cloud:
  • Tests appear in the test overview - View execution history, test queries, and configuration
  • Alerts fire automatically - Get notified via Slack, PagerDuty, or email when tests fail
  • Incidents are created - Automatic incident creation with Jira ticket integration
  • Lineage is connected - Python assets link to dbt models, warehouse tables, and ML outputs
  • Assets are discoverable - All tables, views, and data entities appear in the Elementary catalog

What’s Next?