A client package for running Dagger pipelines in Python.
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
ctr = (
client.container()
.from_("python:alpine")
.with_exec(["pip", "install", "cowsay"])
.with_entrypoint(["cowsay"])
)
# run cowsay with requested message
result = await ctr.with_exec(args).stdout()
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 environment 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
.
Build reference docs with poetry run poe docs
.
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
Built Distribution
Hashes for dagger_io-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0950e22e4d441efc2e9e5a0e992e818f2b27a6fcf8d529c489a91cbcfcba49ff |
|
MD5 | 6668872fa145e6db772373f982f9b7dc |
|
BLAKE2b-256 | f05a0abdd8b5c979149b022aca8b426348fcde1edbc6f629b9e6a3c0a6d8770c |