Registry / observability / lucopy

lucopy

JSON →
library1.3.14pypypi✓ verified 85d ago

LucoPy is a Python SDK designed to facilitate interaction with the Luco data observability tool's API. It provides functionality for submitting data quality results, reporting metrics, and managing data slots. The current stable version is 1.3.14, which was released on September 27, 2023.

pip install LucoPy
INSTALL
IMPORT
SIG · LUCOPY
L
lucopy
observabilitypythonv1.3.14
Install
2.3s avg
Import
615ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.14 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.647s · 21.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.3s · import 0.583s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LucoApi
from LucoPy import LucoApi

This quickstart demonstrates how to initialize the `LucoApi` client. It retrieves authentication details (base URL, tenant ID, client ID, client secret, and resource ID) from environment variables for security. After initialization, the client is ready to interact with the Luco API for data observability tasks.

import os from LucoPy import LucoApi # --- Configuration --- # It is highly recommended to set these as environment variables. # Example: export LUCO_BASE_URL="https://your-luco-instance.com/api" BASE_URL = os.environ.get('LUCO_BASE_URL', 'https://api.luco.data') TENANT_ID = os.environ.get('LUCO_TENANT_ID', '') # Directory (tenant) ID CLIENT_ID = os.environ.get('LUCO_CLIENT_ID', '') # Application (client) ID for LucoPy CLIENT_SECRET = os.environ.get('LUCO_CLIENT_SECRET', '') # Secret value for LucoPy App Registration RESOURCE_ID = os.environ.get('LUCO_RESOURCE_ID', '') # Application (client) ID of the target API if not all([TENANT_ID, CLIENT_ID, CLIENT_SECRET, RESOURCE_ID]): print("Warning: Authentication credentials not fully provided. API calls may fail.") try: # Initialize the Luco API client api = LucoApi( base_url=BASE_URL, tenant_id=TENANT_ID, client_id=CLIENT_ID, client_secret=CLIENT_SECRET, resource_id=RESOURCE_ID ) print(f"Successfully initialized LucoApi client for base URL: {BASE_URL}") # Example: Check API health (if such an endpoint exists and is public, or requires auth) # Note: A real health check might require specific authentication. # For a simple test, we'll just show the client is ready. # In a real scenario, you would perform operations like: # from LucoPy.quality import CheckResult, CollectionResult # check = CheckResult(check_name='MyDataCheck', success=True, observed_value='OK') # collection = CollectionResult(collection_name='DailyChecks', checks=[check]) # api.submit_quality(collection) print("LucoPy client ready. You can now make API calls (e.g., submit_quality, get_metrics).") except Exception as e: print(f"Error initializing LucoApi: {e}") print("Please ensure your BASE_URL and authentication credentials are correct.")
Debug
Known issues
breakingThe return format of the `Submission.get_metrics()` method changed in LucoPy versions 1.3.3, 1.3.4, and 1.3.5. This was a potential breaking change for users.
fix
Upgrade to LucoPy version 1.3.6 or later to use the refactored method. If on an affected version, adjust code to the new return format or pin a version prior to 1.3.3.
affects: 1.3.3 - 1.3.5
gotchaLucoPy attempts to load authentication credentials (tenant ID, client ID, client secret, resource ID, base URL) from environment variables if not provided directly during `LucoApi` instantiation. Failure to set these or provide them as arguments will result in authentication errors.
fix
Ensure environment variables like `LUCO_TENANT_ID`, `LUCO_CLIENT_ID`, `LUCO_CLIENT_SECRET`, `LUCO_RESOURCE_ID`, and `LUCO_BASE_URL` are set, or pass the corresponding values as arguments to the `LucoApi` constructor.
affects: All versions
Errors
Common errors & fixes
API call failed: Authentication token missing or invalid.
The `LucoApi` client could not obtain a valid authenticated access token to make API requests, usually due to missing or incorrect authentication parameters (`base_url`, `tenant_id`, `client_id`, `client_secret`, `resource_id`) during initialization, or invalid credentials.
fix
Verify that all required authentication parameters are correctly provided to the `LucoApi` constructor, either directly or via the specified environment variables (e.g., `LUCO_BASE_ID`, `LUCO_TENANT_ID`, `LUCO_CLIENT_ID`, `LUCO_CLIENT_SECRET`, `LUCO_RESOURCE_ID`). Check for typos or expired secrets.
AttributeError or KeyError when accessing result from `api.submission.get_metrics()`.
This error occurs in LucoPy versions 1.3.3 to 1.3.5 because the return format of `Submission.get_metrics()` was changed.
fix
Update your `lucopy` package to version 1.3.6 or newer (`pip install --upgrade LucoPy`) to use the corrected method signature. Alternatively, if upgrading is not an option, review the specific return format for your exact `lucopy` version (1.3.3-1.3.5) and adjust your code accordingly.
Upgrade
Version history
1.3.14latest on PyPI · released Sep 27, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
2
Amazon
1
Resources
lucopy — pip install lucopy · libregistry