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.1.tar.gz (40.6 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.1-py3-none-any.whl (102.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xclient_python_sdk-0.0.1.tar.gz
  • Upload date:
  • Size: 40.6 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.1.tar.gz
Algorithm Hash digest
SHA256 7cb8898a3265a340e2194f61c9a7a25a86742d9aff67d3260552b2554c3bc450
MD5 8956abf2fd88d914c4c70001a35a0611
BLAKE2b-256 408ceeecb5e20f343d3c51fb7e965cbab17f0ecab2304a9778c7480f365ad7d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xclient_python_sdk-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 102.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21634cc5eb430dfef2fdeb70fccb044c911cb7f3fc2bd16c5acdd2541ff751c6
MD5 752bf3035db3db1ceacac69e13779a96
BLAKE2b-256 c18e5a575e77260d6d57c17b711f8a11c2373ff3ba9472bf4b2d19e5b1503960

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