Skip to main content

XClient Python SDK for XCloud Service API

Project description

XClient

XClient Python SDK for XCloud Service API. Manage and execute jobs with confidence.

Run your first XClient Job

1. Install xclient-python-sdk

pip install xclient-python-sdk

2. Setup your XClient API key

  1. Sign up to XClient
  2. Manage your API key
  3. Create API key, and set environment variable with your API key
export XCLIENT_API_KEY=xck_******
export XCLIENT_DOMAIN=localhost:8090  # optional, default is localhost:8090

3. Execute code with XClient Job

from xclient import Job

job = Job(api_key="xck_******")

# Submit a job
result = job.submit(
    name="my-training-job",
    script="#!/bin/bash\necho 'Hello World'",
    cluster_id=1,
    resources={"cpu": 4, "gpu": 1, "memory": "8GB"}
)

# Get job details
job_info = job.get(job_id=result.job_id, cluster_id=1)

# List jobs
from xclient.api.client.models.job_status import JobStatus
running_jobs = job.list(status=JobStatus.RUNNING, page=1, page_size=20)

# Cancel a job
job.cancel(job_id=result.job_id)

4. Documents

Visit XClient Documents

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

xclient_python_sdk-0.0.2.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

xclient_python_sdk-0.0.2-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file xclient_python_sdk-0.0.2.tar.gz.

File metadata

  • Download URL: xclient_python_sdk-0.0.2.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.8 Darwin/23.2.0

File hashes

Hashes for xclient_python_sdk-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2de3b75194a006c694460511cc41201e2892f72085401707497f70e220c5a9dd
MD5 f5bc65f42e4bbf181aa61ec63d58b9c7
BLAKE2b-256 e6d1f811fae878d460a59cd519cb53dbd92bf35c3d2b4b1f4879c2f72aeef537

See more details on using hashes here.

File details

Details for the file xclient_python_sdk-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: xclient_python_sdk-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 39.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.8 Darwin/23.2.0

File hashes

Hashes for xclient_python_sdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24943df8e8aa91c2db24d5d0f03aa626865964d0168af221e7a78969f7fa2a8a
MD5 17815d6c8355f355e933cf6881101611
BLAKE2b-256 4a9799ede2cf83ff0122601fcaa59f1478d22acadd1f6c4306d5ad5eb5ad2fd6

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