Skip to main content

The official Superb AI Curate client for Python

Project description

superb-ai-curate

Coverage Status Version License: MIT

Overview

superb-ai-curate is the Python client for interacting with Superb Curate.

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

$ pip install --upgrade superb-ai-curate

Requirements

Python 3.7+

Documentation

You can also find the documentation for superb-ai-curate on the website.

Usage

An Access Key is required to use the python client. This can be generated from the Settings > Access menu on the Superb AI Curate website. For more details on access key issuance and management, you can check the Access Key Management documentation. The Team Name refers to the organization name that your personal account belongs to.

import spb_curate
from spb_curate import curate

spb_curate.access_key = "..."
spb_curate.team_name = "..."

dataset = curate.fetch_dataset(id="...")

images = [
    curate.Image(
        key="<unique image key>",
        source=curate.ImageSourceLocal(asset="/path/to/image"),
        metadata={"weather": "clear", "timeofday": "daytime"},
    ),
    curate.Image(
        key="<unique image key>",
        source=curate.ImageSourceLocal(asset="/path/to/image"),
        metadata={"weather": "clear", "timeofday": "daytime"},
    ),
]

job: curate.Job = dataset.add_images(images=images)
job.wait_until_complete()

Configuring per-request

For use with multiple credentials, the requests can be configured at the function level.

from spb_curate import curate

dataset = curate.fetch_dataset(access_key="...", team_name="...", id="...")

Logging

If required, the client can be configured to produce basic logging output. There are two levels that are logged to, INFO and DEBUG. For production use, INFO is the recommended logging level, however DEBUG can be used for more verbosity.

There are several methods for setting the log level.

  1. Environment variable
$ export SPB_LOG_LEVEL = "INFO"
  1. Superb AI Curate Python client global setting
import spb_curate

spb_curate.log_level = "INFO"
  1. Python logging library
import logging

logging.basicConfig()
logging.getLogger("superb-ai").setLevel(logging.INFO)

Development

The development environment relies on Poetry for package management, testing and building.

$ poetry install -E dev
$ poetry run pytest --cov=spb_curate tests

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

superb_ai_curate-1.5.0.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

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

superb_ai_curate-1.5.0-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file superb_ai_curate-1.5.0.tar.gz.

File metadata

  • Download URL: superb_ai_curate-1.5.0.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/23.3.0

File hashes

Hashes for superb_ai_curate-1.5.0.tar.gz
Algorithm Hash digest
SHA256 6bb1c12471ddaab707b6c89d6ae1af28c80e9faf1a38befd47e308b41d3896be
MD5 18d0ab14480e5bc3a8d27a1afa706cfc
BLAKE2b-256 5ad368f4bab115f4d783661d4c4b2f9c2ed923a7a498ef751b72250c1fcb5509

See more details on using hashes here.

File details

Details for the file superb_ai_curate-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: superb_ai_curate-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/23.3.0

File hashes

Hashes for superb_ai_curate-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33221e76aafe4149285c26a11641400c12e85281bc5b647ed88901bcc33bf5ef
MD5 16a794e2a98b5163cc61535683a0df67
BLAKE2b-256 97d4cd64dd3a81d424e7b3c4a0565f0dac324674a75d09bdebca93ec759ec5bd

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