Skip to main content

saltant SDK for Python

Project description

Build Status codecov Documentation Status PyPI PyPI - Python Version Code style: black

saltant SDK for Python

saltant-py is a Python SDK for saltant. It lets you perform any action possible on the saltant API (some much more conveniently) within the comforts (hopefully) of Python. As a refresher, you might want to look at saltant's API reference to see what actions are possible.

The documentation for saltant-py is fairly comprehensive, and can be found at saltant-py.readthedocs.io.

Installation

Using pip,

pip install saltant-py

or, from source, after cloning this repository, run

python setup.py install

where python is in versions 2.7 or 3.5+.

Usage

After connecting to the saltant server with

from saltant.client import from_env
client = from_env() # uses env vars

or

from saltant.client import Client
client = Client(
    base_api_url='https://shahlabjobs.ca/api/',
    auth_token='p0gch4mp101fy451do9uod1s1x9i4a')

You can perform API operations on task types:

# Load in a task type
my_task_type = client.container_task_types.get(id=1)

# Edit the description of the task type
my_task_type.description = "this description is better"

# Push the description upstream
my_task_type.put()

You can launch task instances:

# Launch a task instance
my_task_instance = client.container_task_instances.create(
    task_type_id=my_task_type.id,
    task_queue_id=1,
    arguments={"launch_code": 12345},
)

# Wait for the task instance to finish
my_task_instance.wait_until_finished()

And much more! (See the docs for more details.)

See also

saltant-cli, a saltant CLI.

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

saltant-py-0.3.0.tar.gz (13.9 kB view details)

Uploaded Source

File details

Details for the file saltant-py-0.3.0.tar.gz.

File metadata

  • Download URL: saltant-py-0.3.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for saltant-py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1e3f41211e33b26ee9613f52336c5f4d7aebeadb22519e0336a6b5d673a52897
MD5 a9616dde183a905b83f8a47777d7b9d3
BLAKE2b-256 2af88a1dd7fdb42c862252acd1a971735b258b62f5079536ac6c541543552fe4

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