Skip to main content

Simplifies interacting with Bailo programmatically

Project description

Bailo Python Client

PyPI - Python Version PyPI - Version License Contributor Covenant

A lightweight, Python API wrapper for Bailo, providing streamlined programmatic access to its core functionality - designed for Data Scientists, ML Engineers, and Developers who need to integrate Bailo capabilities directly into their workflows.


Table of Contents
  1. Quickstart
  2. Documentation
  3. Development

Quickstart

Requires: Python 3.10 to 3.14

Installation

pip install bailo

Optional: enable integration with MLFlow for advanced model tracking:

pip install bailo[mlflow]

Basic Usage

from bailo import Client, Model

# Connect to Bailo server
client = Client("http://localhost:8080")

# Create a model
yolo = Model.create(
    client=client,
    name="YoloV4",
    description="You only look once!"
)

# Populate datacard using a predefined schema
yolo.card_from_schema("minimal-general-v10")

# Create a new release
my_release = yolo.create_release(
    version="0.1.0",
    notes="Beta"
)

# Upload a binary file to the release
with open("yolo.onnx") as f:
    my_release.upload("yolo", f)

Core Features

  • Upload and download model binaries
  • Manage Models & Releases
  • Handle Datacards & Schemas
  • Manage Schemas
  • Process Access Requests

Note: Certain collaborative actions (approvals, review threads, etc.) are best handled via the Bailo web interface.

Documentation

Full Python client documentation: Bailo Python Docs.

Building locally

Refer to backend/docs/README.md for local build steps.

Development

The following steps are only required for users who wish to extend or develop the Bailo Python client locally.

Python Setup

From within the lib/python directory:

python3 -m venv libpythonvenv
source libpythonvenv/bin/activate
pip install -e .[test]

Running Tests

To run the unit tests:

pytest

To run the integration tests (requires Bailo running on https://localhost:8080):

pytest -m integration

To run the mlflow integration tests (requires Bailo running on https://localhost:8080 and mlflow running on https://localhost:5050 e.g. via docker):

docker run -p 5050:5000 \
    "ghcr.io/mlflow/mlflow:v$(python -m pip show mlflow | awk '/Version:/ {print $2}')" \
    mlflow server --host 0.0.0.0 --port 5000

pytest -m mlflow

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

bailo-3.7.2.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

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

bailo-3.7.2-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file bailo-3.7.2.tar.gz.

File metadata

  • Download URL: bailo-3.7.2.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bailo-3.7.2.tar.gz
Algorithm Hash digest
SHA256 5698a127d75c35845c1312c4e96975a42c5ae69ad6ea5bb3540d95109cab2ebb
MD5 4b0dbd80795fe4671e0b31cc4fdf2f6c
BLAKE2b-256 9c5fde431c4b887223c70bd0f444b9d8684c6b3f755019bb2ef8fa59e4330db8

See more details on using hashes here.

Provenance

The following attestation bundles were made for bailo-3.7.2.tar.gz:

Publisher: python-publish.yml on gchq/Bailo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bailo-3.7.2-py3-none-any.whl.

File metadata

  • Download URL: bailo-3.7.2-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bailo-3.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b734e804f3936450d779230a36b2f3bb2ff64d178d9a914e6ceea7055470807e
MD5 e59b096a06caa9b997a72ac42801abe7
BLAKE2b-256 a3514c34d17811786ff39b881f2ca8aa1ba8faba4f979d4daca065a0128113d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for bailo-3.7.2-py3-none-any.whl:

Publisher: python-publish.yml on gchq/Bailo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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