Skip to main content

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

Metadata

Release files for cutip-blocks 0.6.0

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

Built distributions (wheels)

Table of built distributions (wheels) for cutip-blocks 0.6.0
File Actions
cutip_blocks-0.6.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for cutip_blocks-0.6.0-cp313-cp313-win_amd64.whl
cutip_blocks-0.6.0-cp313-cp313-manylinux_2_39_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.39+ x86-64 Details for cutip_blocks-0.6.0-cp313-cp313-manylinux_2_39_x86_64.whl
cutip_blocks-0.6.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for cutip_blocks-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
cutip_blocks-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details for cutip_blocks-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl

Total release size: 16.4 MB

Release files / cutip_blocks-0.6.0-cp313-cp313-win_amd64.whl

Download URL cutip_blocks-0.6.0-cp313-cp313-win_amd64.whl
Size 3.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
5ab4e6d503693baa9e42fb6269701ab1ea78f178bc7e8182deb06c95d3f3eb0c
BLAKE2b-256 checksum
How to use checksums
b482c7d00d698fec4efd34f3d8d0193fe1bab67e49ca46cda4677ed7d7a0fbe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / cutip_blocks-0.6.0-cp313-cp313-manylinux_2_39_x86_64.whl

Download URL cutip_blocks-0.6.0-cp313-cp313-manylinux_2_39_x86_64.whl
Size 5.8 MB
Tags CPython 3.13 Linux glibc 2.39+ x86-64
SHA-256 checksum
How to use checksums
dcf673b869385967d09775cc99f7414256c03196952e6c676493663af0c14c60
BLAKE2b-256 checksum
How to use checksums
551367c1d4f6e2366b3ebf7a160359d2eb35c5157bf393c9f3b5b87270cd44ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / cutip_blocks-0.6.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL cutip_blocks-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Size 3.4 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
47d63c97ad6c5f5d0e0e7d65a7467e6f4db3376d01b1aa657ac066190f3a6588
BLAKE2b-256 checksum
How to use checksums
b9d4722b676aef1efc97c4afdab8b3a50b991a30214c882e0adbae4a726b5bf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / cutip_blocks-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl

Download URL cutip_blocks-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl
Size 3.6 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8263d1cc02910480245232fb96f32a1980a780c34512258dbf19d5ffcbd74b5d
BLAKE2b-256 checksum
How to use checksums
30941d10f1fea69407f72c98609af0ce831f2b18dcdf1893b30b39e8ebdd3897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for cutip-blocks 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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