Skip to main content

A client package for running Dagger pipelines in Python.

Reason this release was yanked:

Superseded with first stable

Project description

Dagger Python SDK

A client package for running Dagger pipelines.

What is the Dagger Python SDK?

The Dagger Python SDK contains everything you need to develop CI/CD pipelines in Python, and run them on any OCI-compatible container runtime.

Example

# say.py
import sys
import anyio

import dagger


async def main(args: list[str]):
    async with dagger.Connection() as client:
        # build container with cowsay entrypoint
        # note: this is reusable, no request is made to the server
        ctr = (
            client.container()
            .from_("python:alpine")
            .exec(["pip", "install", "cowsay"])
            .with_entrypoint(["cowsay"])
        )

        # run cowsay with requested message
        # note: methods that return a coroutine with a Result need to
        # await query execution
        result = await ctr.exec(args).stdout().contents()

        print(result)


if __name__ == "__main__":
    anyio.run(main, sys.argv[1:])

Run with:

$ python say.py "Simple is better than complex"
  _____________________________
| Simple is better than complex |
  =============================
                             \
                              \
                                ^__^
                                (oo)\_______
                                (__)\       )\/\
                                    ||----w |
                                    ||     ||

Learn more

Development

Requirements:

Start enviornment with poetry install.

Run tests with poetry run poe test.

Reformat code with poetry run poe fmt or just check with poetry run poe lint.

Re-regenerate client with poetry run poe generate.

Tip: You don't need to prefix the previous commands with poetry run if you activate the virtualenv with poetry shell.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagger_io-0.1.0a1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

dagger_io-0.1.0a1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file dagger_io-0.1.0a1.tar.gz.

File metadata

  • Download URL: dagger_io-0.1.0a1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for dagger_io-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 8ce2b78bd7320ebb27455f495b1cdfb93351ffaed51cc6da365dae1d2474dea5
MD5 f2892e2b7069754961ec23e424254500
BLAKE2b-256 e3417d96e8341725bab09d6da86cf4b73762f6799183aa2ad513a1465dfc0ece

See more details on using hashes here.

File details

Details for the file dagger_io-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: dagger_io-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for dagger_io-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b029e87248127bc30b70ccb256ba20be988692dc7b334cec23b8fdd6da9d05b
MD5 8998e73ae8e868439cc3ccff11bb3c34
BLAKE2b-256 11b4e912fdb392eb0e1273fb9ac192c4e605f7e0e7dba0b124e789a7da55d10a

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