Skip to main content

Run Python jobs on the cloud using DISCO

Project description

Dis.co Python SDK

Coverage Status

This package lets you run jobs on Dis.co platform from a Python program.

Using the SDK, you can create computing jobs, run them on Dis.co, and get their results to your local machine. It is possible to offload any kind of Python program to be run on Dis.co.

Prerequisites

  1. An Dis.co account.

  2. Python version 3.6 and up.

  3. Dis.co Python SDK installed:

    $ pip install disco
    

Example

import disco
import pathlib

disco.set_credentials('john@example.com', 'my_password', save_to_config=True)

my_file_id = disco.upload_file('my_file.py', pathlib.Path('/home/bob/my_file.py'))
job = disco.Job.create(my_file_id)
job.start()

(task_result,) = job.get_results(block=True)
task_result.write_files('/home/bob/my_result')

The code above uploads the file /home/bob/my_file.py, runs it on Dis.co cloud, waits for the job to finish, and writes the results to /home/bob/my_result.

When the job has been created, you can see it listed in list_jobs():

>>> import disco
>>> disco.Job.list_jobs())
[{'id': '5d650d25179854000d72b8cc', 'archived': False, 'name': 'd08e3e029bfc412ebc316e21f1a7dae0', 'status': 'Done', 'taskStates': ['Success']}]

This functions returns an instance of Job, which gives access to many useful operations on a job (see the API documentation).

Environment variables

The disco package supports these environment variables:

  • DISCO_BASE_URL - base URL of the Dis.co server. Default: https://app.dis.co
  • DISCO_EMAIL - user's email to for authenticating with the Dis.co server.
  • DISCO_PASSWORD - password for authenticating with the Dis.co server.
  • DISCO_LIVE_TESTS - set true to run our live 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

disco-1.17.1.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

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

disco-1.17.1-py3-none-any.whl (60.8 kB view details)

Uploaded Python 3

File details

Details for the file disco-1.17.1.tar.gz.

File metadata

  • Download URL: disco-1.17.1.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for disco-1.17.1.tar.gz
Algorithm Hash digest
SHA256 521d8766149191e05c669ce389c4f4312ccfa93ac1f05d4f90bbd70d38559e3d
MD5 032d596be582e04f4f61873db743197f
BLAKE2b-256 492d3d8e9fe831f8020c23f4c4afd01cb64447fa28934ab8c8e9241e17ba77f0

See more details on using hashes here.

File details

Details for the file disco-1.17.1-py3-none-any.whl.

File metadata

  • Download URL: disco-1.17.1-py3-none-any.whl
  • Upload date:
  • Size: 60.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for disco-1.17.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61776e85b3a5931f7d05d04ec024f13036517bab3ff6660ff33c0c7233b926ed
MD5 ee43c553f32d64b89465a3664fa0a4cf
BLAKE2b-256 81b5b12dafecaafaedc6b48f159bd4ded99195236c3170bccb6c507c974d397f

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