Skip to main content

No project description provided

Project description

pyoso

WARNING: THIS IS A WORK IN PROGRESS

pyoso is a Python package for fetching models and metrics from OSO. This package provides an easy-to-use interface to interact with oso and retrieve valuable data for analysis and monitoring.

Features

  • Execute custom SQL queries for analyzing the OSO dataset.
  • Inspect data dependencies and freshness with an analytics tree.
  • Semantic modeling layer to build and execute complex queries (optional).

Installation

You can install pyoso using pip:

pip install pyoso

Optional Semantic Modeling

For semantic modeling capabilities, you can install with the semantic extra:

pip install pyoso[semantic]

This will include the oso_semantic package for building semantic models and queries.

Usage

Here is a basic example of how to use pyoso to fetch data directly into a pandas DataFrame:

import os
from pyoso import Client

# Initialize the client with an API key
os.environ["OSO_API_KEY"] = 'your_api_key'
client = Client()

# Fetch artifacts
query = "SELECT * FROM artifacts_v1 LIMIT 5"
artifacts = client.to_pandas(query)

print(artifacts)

Inspecting Data Dependencies

For more advanced use cases, the client.query() method returns a QueryResponse object that contains both the data and analytics metadata. This allows you to inspect the dependency tree of the data sources used in your query.

import os
from pyoso import Client

# Initialize the client
os.environ["OSO_API_KEY"] = "your_api_key"
client = Client()

# Execute a query to get a QueryResponse object
query = "SELECT * FROM artifacts_v1 LIMIT 5"
response = client.query(query)

# You can still get the DataFrame as before
df = response.to_pandas()
print("\n--- Query Data ---")
print(df)

# Now, inspect the analytics to see the dependency tree
print("\n--- Data Dependency Tree ---")
response.analytics.print_tree()

This will output a tree structure showing how the final artifacts_v1 table was constructed from its upstream dependencies, helping you understand the data's origin and freshness.

Documentation

For detailed documentation about the OSO dataset, please refer to the official documentation.

Future Plans

  • Create DataFrame wrapper for creating SQL query from data transforms

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyoso-0.6.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyoso-0.6.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pyoso-0.6.0.tar.gz.

File metadata

  • Download URL: pyoso-0.6.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.1

File hashes

Hashes for pyoso-0.6.0.tar.gz
Algorithm Hash digest
SHA256 af4f0321cc24ca5898aeada86d8131f32df35ba48989e9a595fafe8af9b9b020
MD5 576e4522cc5ed1923221be29034b396c
BLAKE2b-256 0dbb65e55231ae02edaf6f478e48bcd3662a4d359f2d154bc4606a47dfa7ac6a

See more details on using hashes here.

File details

Details for the file pyoso-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: pyoso-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.1

File hashes

Hashes for pyoso-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bad3bafb107252f5182c42b6d1f7f153db1d650f4b1263f4d480166c3412967
MD5 e09b487549e5358b84f346dc83472221
BLAKE2b-256 43bee6a9112148b13a6562ca37243498c4c4a4210491653f3996067dbddccef1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page