Skip to main content

Python-typed Rust modules for workflow automation — SSH, containers, files, HTTP, packages, services, templates

Project description

cutip-blocks

Python 3.11+ Rust License: MIT

Rust-backed workflow blocks for CUTIP. Write Python, execute Rust.

Every function you call from cutip_blocks is a compiled Rust binary under the hood — SSH via russh, Docker/Podman via bollard, HTTP via reqwest, YAML/JSON via serde. Zero Python dependencies. The Python GIL is released during all I/O.

Install

pip install cutip-blocks

Modules

Module Rust crate What it does
ssh russh Persistent SSH sessions — connect(), exec(), probe()
kubectl serde Kubernetes ops over SSH — get, exec, find_pod, patch_deployment, patch_file_from_pod
container bollard Docker/Podman — start, stop, remove, exec, pull
file std::fs + serde copy, copy_tree, read/write_json, read/write_yaml, replace
http reqwest get, post, put, delete with JSON + TLS toggle
network bollard create, remove, exists
service reqwest + bollard poll_until_ready, wait_for_exit
validate std path_exists, env_var_set, ip_valid
config string ops render_template, substitute_vars

Usage

SSH + kubectl (remote VM operations)

from cutip_blocks import ssh, kubectl

with ssh.connect(host="10.0.0.1", username="root", password=pw) as sesh:
    sesh.probe()  # verify connectivity

    kube = kubectl.connect(sesh, namespace="prod")
    kube.get("deployment", name="web")
    kube.find_pod(name_prefix="web")

    password = kube.get_secret_value(secret="db-creds", key="password")
    kube.exec(target="deploy/web", cmd="cat /app/config.py")

    kube.patch_file_from_pod(
        deployment="web",
        source_file="/opt/app/handler.py",
        dest_dir="/root/patches",
        replacements={"old_value": "new_value"},
    )

    kube.patch_deployment(
        deployment="web",
        volume_name="config-override",
        host_path="/root/patches/handler.py",
        mount_path="/opt/app/handler.py",
    )

Container management

from cutip_blocks import container

rt = container.connect()  # auto-detect Docker/Podman
rt.pull("nginx", tag="latest")
rt.start("my-container")
result = rt.exec("my-container", "nginx -t")
print(result.stdout)
rt.stop("my-container")
rt.remove("my-container")

File operations

from cutip_blocks import file

data = file.read_json("config.json")
file.copy_tree("src/", "build/deps/")
file.replace("config.yaml", "old_value", "new_value")
file.write_yaml("output.yaml", {"key": "value"})

HTTP

from cutip_blocks import http

resp = http.post("https://api.example.com/token",
                 json={"username": "admin", "password": "secret"},
                 verify_tls=False)
token = resp.json()["access_token"]

Development

Requires Rust toolchain + Python 3.11+.

git clone https://github.com/joshuajerome/cutip-blocks.git
cd cutip-blocks
python -m venv .venv && source .venv/bin/activate
pip install maturin pytest
maturin develop
pytest tests/ -v

Ecosystem

Project Description
cutip Workflow automation framework
cutip-blocks Rust-backed blocks (this repo)
cutip-desktop Visual companion — DAG, container management

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

rsty-0.11.4-cp313-cp313-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.13Windows x86-64

rsty-0.11.4-cp313-cp313-manylinux_2_28_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

rsty-0.11.4-cp313-cp313-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rsty-0.11.4-cp313-cp313-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

rsty-0.11.4-cp312-cp312-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.12Windows x86-64

rsty-0.11.4-cp312-cp312-manylinux_2_28_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

rsty-0.11.4-cp312-cp312-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rsty-0.11.4-cp312-cp312-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

rsty-0.11.4-cp311-cp311-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.11Windows x86-64

rsty-0.11.4-cp311-cp311-manylinux_2_28_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

rsty-0.11.4-cp311-cp311-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rsty-0.11.4-cp311-cp311-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file rsty-0.11.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rsty-0.11.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rsty-0.11.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7f9bd7a8d63f9e0d18bc78485afad2a319e2997eaa65a8824d0fe41ebb4b71df
MD5 e0c4cd9853f5b17795f436397f63d580
BLAKE2b-256 0449c165b6d470c00f58c946100b07460eacbf744369e2b14203902aaecba1a8

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 888dd38b3fe8ea931fba26da974989f9c91265e6710fc072617510167777ce3e
MD5 7baeaa93cd1bd2f3ffc14d1b7a80cff7
BLAKE2b-256 c934b7861e632332816899193427d8d3886375ca0e40c3de8e7a976916758b62

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c5c652ca1dbb865e724116a59fe55d523ff7db01d557fe5f3ffc32f6833e244
MD5 24c239bb57f4cef4f3dccb8c6060615e
BLAKE2b-256 f7c9fba30f3d29567d17831c7284995ff8ef7a6c8ba6712c33c80babd41c9714

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 00beabde0c3588343258873534326a06a07e8787189fdb92ab881e76762c4289
MD5 91ec40c2275478ca9e1512df8aa31ee4
BLAKE2b-256 f61d153129b9baecd94e3861d73f47202138f1c737b04020349675589cd1b575

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rsty-0.11.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rsty-0.11.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 56ed97608e11a52b333457688872aac19ff5eb5ec1db7f793c03b9b991a5dccc
MD5 dfeed06315f94ccb4b827caf84947548
BLAKE2b-256 e6e473e26cfbf24468dde9ced6f5e65fb2bda3530378d247184ae0bee0d9c8d5

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f559b352994b22f30306f06cee120142fc542053f1edfe63cdd03848ab68ae1b
MD5 0c5554330535061820a7862d2a5c3b19
BLAKE2b-256 183987ff2dd302f79c13f99182d034d2976caf17fe276e4ff56e560d4a2ccd3b

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ccd66a808ded4f9f7bb168d164730dd5f077f181bde08363516a812d3bfcec9
MD5 aaa0643a80773f4ca8b48afa224c69e5
BLAKE2b-256 b8527dd9992d6b454f84fbab7a43696580248c4256023987ad8de0575c1378aa

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 19f09a78426297cf63d38ab18354f1f3debb7ae2b68d53363a5f8276fb1ca14a
MD5 5d5f646f003d5462ce3453de3b3cd17b
BLAKE2b-256 d81ee0f4bcceaad634a028c6c67fc933d2383c51e335482d13d8137559ab8c55

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rsty-0.11.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rsty-0.11.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f26589cc43707f315450eccc4f4eb7f725b2200cb4973e576d60f0066891886c
MD5 c483d13ace8e556173625a651e2bfc3c
BLAKE2b-256 d7b2726c87521c4ebfc542ca7918a3c334ad756ccc6deb5a2567d7a1b1da686f

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c02f17a39fdbc81adeae28715524e4d58777bf1ca184184cf2be14f4d4a5cbe4
MD5 2802dd70cc5eb60e67e75d29929ab72e
BLAKE2b-256 a34d55d17aca99de51940b828f6f758b54a399f202799d619d6ed775532fadba

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4157e0eb637ed01c641710f87145c66bd61a837ea5cdbaff91f14f03a38dc0ae
MD5 ded3198d29cc0b27a190612a23570baa
BLAKE2b-256 71e2d3a72ff7660bf24fb1529f7d4b1424cf432e1f5a7552ca76f5a99022ca33

See more details on using hashes here.

File details

Details for the file rsty-0.11.4-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rsty-0.11.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 499fc546cb96f0387d957dee3f96cccc79c1c8da81fa4d559d93ce3fed9f2519
MD5 421fc95d2928034749f31027624e49c7
BLAKE2b-256 5905e762ffe117c0a0dfd4ad65dd919da837a228546bf10f1ba662d9aa296960

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