Skip to main content

Python client for SaaS optimization API

Project description

opticlient

A lightweight Python client for interacting with the SaaS optimization API.
This package provides a clean interface for submitting optimization jobs, polling their status, and retrieving results.

Currently supported tools:

  • Single Machine Scheduling (sms) — submit an Excel instance and obtain an ordered job schedule.

More tools will be added in future versions.


Installation

pip install opticlient

Installation

The Opti API requires an API key, which you obtain from the Opti web dashboard.

You can provide it in either of two ways:

Option 1 - Environment variable (recommended)

export OPTICLIENT_API_TOKEN="YOUR_API_KEY"

Option 2 - Pass directly in code

from opticlient import OptiClient

client = OptiClient(api_token="YOUR_API_KEY")

Base URL Configuration

By default, the client uses the production API URL baked into the library.

To target a different server (e.g., local development)

Option 1 - Environment variable

export OPTICLIENT_BASE_URL="http://localhost:8000"

Option 2 - Pass directly in code

client = OptiClient(
    api_token="YOUR_API_KEY",
    base_url="http://localhost:8000",
)

Quick Start: Single Machine Scheduling (SMS)

The SMS tool takes an Excel file describing a scheduling instance and returns an ordered sequence of jobs.

Basic usage

from opticlient import OptiClient

client = OptiClient()  # reads token/base URL from environment if available

schedule = client.sms.run(
    file_path="instance.xlsx",
    description="Test run",
)

print("Job schedule:")
for job in schedule:
    print(job)

What sms.run() does

client.sms.run() is a high-level wrapper that:

  1. Validates your Excel file.
  2. Submits it to the API.
  3. Polls until the job completes.
  4. Downloads the result ZIP in memory.
  5. Parses output/jobs.txt and returns a simple Python list[str] representing the scheduled job order.

Versioning

This package follows semantic versioning:

  • 0.x — early releases, API may change
  • 1.0+ — stable API

License

MIT License See LICENSE for details

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

opticlient-0.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

opticlient-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file opticlient-0.1.0.tar.gz.

File metadata

  • Download URL: opticlient-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for opticlient-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ccd229470241763c706db5c685fb7a002b89b3df43ecf1cb4410bcca3db0e46
MD5 ac8369a96d6ecf966b6578b9870f36a8
BLAKE2b-256 6fb6dc5f17b2bdcaff5b3010842fa543940c5889971da4a512560a0b631c3233

See more details on using hashes here.

File details

Details for the file opticlient-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: opticlient-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for opticlient-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57ea5dfd36425305a8fb09054d200b9f1a17573417d64aab408278b867694219
MD5 243a960b1f8038390296ab3e406a77ff
BLAKE2b-256 4c713fd0549e8f5779f7f7b1978ec268a318bf5b27d801ec00708c7744543cf2

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