Skip to main content

cmfapi

This package provides a simple, modular SDK for the Common Metadata Framework (CMF) REST API.

Installation

Install using pip:

pip install cmfapi

Install from source:

git clone https://github.com/atripathy86/cmfapi.git
cd cmfapi
pip install -e .

Build/Upload for pypi:

pip install build
# Build the package
python -m build 
#Creates dist/ with tar.gz and .whl 
  • Verify ~/.pypirc has PyPi token
pip install twine
twine upload dist/*

Quick Start

Initialize the Client

from cmfapi import cmfClient
client = cmfClient("http://192.168.2.143:8080")

Example Usage

See test.py

Get CMF API Server Pipelines

pipelines = client.get_pipelines()
print(pipelines)  

Get list of executions for a pipeline

if pipelines:  # Check if the list is not empty
    first_pipeline = pipelines[0]

executions_list = client.get_executions_list(first_pipeline)
print(f"Executions List for {first_pipeline}:")
print(json.dumps(executions_list, indent=4))

Get Execution details for a pipeline

executions = client.get_executions(first_pipeline)
print(f"Executions for {first_pipeline}:")
print(json.dumps(executions, indent=4))

Get Artifact Types in DB

artifact_types = client.get_artifact_types()
print("Artifact Types in DB:")
print(json.dumps(artifact_types, indent=4))

Display Artifacts for a pipeline

if artifact_types: 
    first_artifact_type = artifact_types[0]
    print(f"First Artifact Type: {first_artifact_type}")

artifacts = client.get_artifacts(first_pipeline, first_artifact_type)
print(f"Artifacts for {first_pipeline} of type {first_artifact_type}:")
print(json.dumps(artifacts, indent=4))

Fetch artifact lineage for a pipeline

artifact_lineage_tree = client.get_artifact_lineage_tangled_tree(first_pipeline)
print(f"Artifact Lineage Tree for {first_pipeline}:")
print(json.dumps(artifact_lineage_tree, indent=4))

Fetch execution lineage for a pipeline

#Select a particular UUID
if "items" in executions and len(executions["items"]) > 0:
    first_execution = executions["items"][0]  # Get the first execution item
    execution_uuid = first_execution["Execution_uuid"]  # Access the Execution_uuid field
    selected_uuid = execution_uuid[:4]  # Slice the first 4 characters
    print(f"Selected Execution UUID (First 4 characters): {selected_uuid}")
else:
    print("No executions found.")
 
uuid = selected_uuid # Example UUID
pipeline_name = first_pipeline  # Use the first pipeline from the pipelines list

execution_lineage_tree = client.get_execution_lineage_tangled_tree(uuid, pipeline_name)
print(f"Execution Lineage Tree for UUID {uuid} and Pipeline {pipeline_name}:")
print(json.dumps(execution_lineage_tree, indent=4))

Metadata

Release files for cmfapi 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmfapi 0.0.2
File Size Uploaded Provenance
cmfapi-0.0.2.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cmfapi 0.0.2
File Interpreter ABI Platform
cmfapi-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / cmfapi-0.0.2.tar.gz

Download URL cmfapi-0.0.2.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
df4230ec4eb09142abc4fce4261f53e4886ddd3e9e1d5ae24bdc5826c7a32c1b
BLAKE2b-256 checksum
How to use checksums
8630c7ebcc0f599d9ddce212953352e77b8fe36573ff2a7805310bcdf91ca75f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / cmfapi-0.0.2-py3-none-any.whl

Download URL cmfapi-0.0.2-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac25db0230c99149677511fa20b7e0a4e5a084c2018d354f67e6fca4e5abceb2
BLAKE2b-256 checksum
How to use checksums
f5876c900f8f7a575c1a1a081b5409b1b7d132812c49df7b9efd61544a324d0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Security for cmfapi 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page