Skip to main content

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.

Release files for disco 1.40.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for disco 1.40.4
File Size Uploaded
disco-1.40.4.tar.gz 70.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for disco 1.40.4
File Interpreter ABI Platform
disco-1.40.4-py3-none-any.whl Python 3 none any Details

Total release size: 173.4 kB

Release files / disco-1.40.4.tar.gz

Download URL disco-1.40.4.tar.gz
Size 70.6 kB
Tags Source
SHA-256 checksum
How to use checksums
112a9ee4af9bece072456b0d9ec8f2b10b0d16799ae2c7d3e946f50c8035a6ff
BLAKE2b-256 checksum
How to use checksums
3160756ea150918dc6aa77d3148650e459596cc640a47cc98dde272051892f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release files / disco-1.40.4-py3-none-any.whl

Download URL disco-1.40.4-py3-none-any.whl
Size 102.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
195e2c11bd0d18361ace11307e6546713aab277e406f989112b8d3d387873fc9
BLAKE2b-256 checksum
How to use checksums
6123433d4835d02b14af4ee78f18510f045c4b5dc813b9e344543c402d379171
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

1.40.4 This release

2 release files

1.40.1

2 release files

1.40.0

2 release files

1.37.2

2 release files

1.37.1

2 release files

1.37.0

2 release files

1.36.0

2 release files

1.35.0

2 release files

1.34.1

2 release files

1.34.0

2 release files

1.33.2

2 release files

1.33.1

2 release files

1.33.0

2 release files

1.32.0

2 release files

1.31.3

2 release files

1.27.0

2 release files

1.26.4

2 release files

1.26.3

2 release files

1.26.2

2 release files

1.23.1

2 release files

1.23.0

2 release files

1.22.1

2 release files

1.22.0

2 release files

1.21.0

2 release files

1.20.1

2 release files

1.20.0

2 release files

1.19.0

2 release files

1.18.2

2 release files

1.18.1

2 release files

1.18.0

2 release files

1.17.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page