Skip to main content

FairOps SDK

FairOps SDK is the standalone client library for integrating machine learning prediction streams into the FairOps compliance pipeline. It enables real-time transmission of prediction events, probabilities, ground truths, and sensitive demographic cuts seamlessly to Google BigQuery and the FairOps Engine.

Installation

You can install the SDK via pip:

pip install fairops-sdk

Quick Start

Integrating your model takes literally 3 lines of code:

from fairops_sdk import FairOpsClient

# 1. Initialize mapping your GCP tracking configurations
client = FairOpsClient(
    project_id="your-gcp-project-id",
    # topic_id="fairops-predictions" # Uses default if omitted
)

# 2. Extract your features / scores
features = {"income": 45000, "credit": "Good"}
demographics = {"race": "White", "sex": "Female"}

# 3. Stream the prediction to the Auditor Pipeline
client.log_prediction(
    model_id="credit-risk-v1",
    prediction_label=1,
    prediction_score=0.88,
    features=features,
    demographic_tags=demographics,
    ground_truth=1  # Optional: Log if doing delayed ground-truth syncing
)

Why FairOps?

The fairops-sdk is an asynchronous, non-blocking telemetry client. When you call log_prediction, the payload is aggressively validated using PyDantic schemas before being offloaded to a background thread to prevent any latency injection on your actual API inference gateways.

It handles network retries, connection backoffs, and strict typing automatically.

Requirements

  • Python 3.11+
  • google-cloud-pubsub
  • pydantic >= 2.6.0

Authors & License

Maintained by the FairOps Open Source team. Licensed under Apache 2.0.

Metadata

Release files for fairops-sdk 0.1.0

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

Source distribution (sdist)

Source distribution for fairops-sdk 0.1.0
File Size Uploaded
fairops_sdk-0.1.0.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fairops-sdk 0.1.0
File Interpreter ABI Platform
fairops_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / fairops_sdk-0.1.0.tar.gz

Download URL fairops_sdk-0.1.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1823eb40ab6fcf68b7517bd56d6f3de12b48018cc688d9e63a7cd83a9f9ec80d
BLAKE2b-256 checksum
How to use checksums
8c8b6b944b718dbca6fdebd887f35f7ace3f66be90100e4ad846c2f33182dab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log

Release files / fairops_sdk-0.1.0-py3-none-any.whl

Download URL fairops_sdk-0.1.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f05eaa0a37c9cb58e5a33f80a8e2810c46b4295d351552b117896d3287d21a47
BLAKE2b-256 checksum
How to use checksums
cccfae37f54b72e712d7da2f4caa7d1f80920c17b0bc652a3283854eee4d93f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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