Cua Core Library
cua-core is a Python library providing core utilities and telemetry functionality for the Cua ecosystem. It includes shared components for configuration, logging, versioning, and OpenTelemetry integration. Currently at version 0.1.19, it is designed primarily as a dependency for other Cua-related libraries and is explicitly not intended for direct end-user applications. Its release cadence is likely tied to the development cycles of other Cua projects.
Warnings
- breaking As a `0.x.x` version library, `cua-core` may introduce breaking changes without prior deprecation warnings between minor or patch releases. Its API is not considered stable for external use.
- gotcha `cua-core` is intended as an internal dependency for the Cua ecosystem and is explicitly "not intended for direct use" by end-user applications. Its public API may not be fully documented or user-friendly, and its design prioritizes internal consistency over external usability.
- gotcha Many core functionalities, especially telemetry and logging, are tightly integrated with Google Cloud Platform (GCP) services (e.g., Google Cloud Logging, Monitoring, OpenTelemetry Exporter for GCP). Direct use of these features requires a properly configured GCP environment.
Install
-
pip install cua-core
Imports
- get_library_version
from cua_core.utils import get_library_version
- TelemetryClient
from cua_core.telemetry import TelemetryClient
Quickstart
from cua_core.utils import get_library_version
# Retrieve the version of the cua-core library itself.
# This function provides a simple, direct interaction with the library's utilities.
library_version = get_library_version()
print(f"Cua Core Library Version: {library_version}")
# Further utilities exist in cua_core.utils and cua_core.telemetry,
# but their direct usage is generally discouraged as cua-core is primarily a dependency.
# For example, to instantiate a TelemetryClient:
# from cua_core.telemetry import TelemetryClient
# tele_client = TelemetryClient(project_id=os.environ.get('GCP_PROJECT_ID', 'your-gcp-project-id'), service_name="my-app")
# However, this requires a valid GCP project ID and is usually handled by higher-level Cua libraries.