Skip to main content

Code Craft AI Python RPC - codecraftai-python-rpc

The codecraftai-python-rpc package is a remote procedure call (RPC) layer for the ccai suite that is designed with distributed automation in mind. Its two defining goals are:

  • Explicit object passing semantics. Objects that cross the wire are wrapped as ByRef or ByValue so the caller declares, in code, whether a parameter is proxied back to its owner or flattened and copied. Nothing is silently pickled or silently proxied.

  • Callback threading that keeps automation stable. Every session multiplexes one socket across dedicated receive and transmit threads and hands inbound messages to a LooperPool of dispatch workers, so a callback from the far side never blocks the thread that is waiting on a reply.

The package is an alternative to rpyc style libraries for cases where the implicit threading and implicit netref behaviour of those libraries makes long running automation hard to reason about.

Highlights

  • ccai.rpc.core.protocol - the binary message framing (message type, message code, origin id) and the request and reply message classes such as RequestPing, RequestCall and ReplyPong.

  • ccai.rpc.core.duplexsocketio - length-prefixed message transmit and receive over a socket.

  • ccai.rpc.core.duplexclientsession / duplexserversession - the per-connection session objects that own the receive thread, the transmit thread and the dispatch pool.

  • ccai.rpc.core.looper, looperqueue and looperpool - the thread pool primitives used to dispatch inbound requests and callbacks.

  • ccai.rpc.core.proxy - the ByRef and ByValue wrappers that declare passing semantics.

  • ccai.rpc.rpcsocketclient / rpcsocketserver - the RpcSocketClient and RpcSocketServer entry points that a service and its consumers use.

Status

The package is implemented end to end: framing and a pickle-free codec, sessions with correlation, remote exceptions, heartbeats and leases, typed proxies, ordered one-way callbacks, asynchronous calls with cancellation and progress, aspects-driven behaviour, TLS and token authentication. The test suite under source/tests exercises the full stack in-process and over TCP. The design record for each feature is under specs/.

Quick Start

from typing import Protocol
from ccai.rpc import RpcSocketServer, RpcSocketClient, by_ref

class Greeter:
    def greet(self, name: str) -> str:
        return "hello " + name
    def subscribe(self, listener) -> None:
        listener.on_event("subscribed")      # runs on the client's dispatch pool, never its caller thread

class GreeterProtocol(Protocol):
    def greet(self, name: str) -> str: ...
    def subscribe(self, listener) -> None: ...

@by_ref
class Listener:
    def on_event(self, what: str) -> None:
        print("event:", what)

with RpcSocketServer(Greeter(), ("127.0.0.1", 0)) as server:
    with RpcSocketClient(GreeterProtocol, server.bound_endpoint) as client:
        greeter = client.get_service()
        print(greeter.greet("world"))
        greeter.subscribe(Listener())

Code Organization

  • .vscode - Common tasks

  • development - This is where the runtime environment scripts are located

  • prompts - Pre-built prompts for agent driven work such as bug bashes

  • repository-setup - Scripts for homing your repository and to your checkout and machine setup

  • specs - Requirements, design and task specifications that steer development

  • userguide - The user guide and the coding standards for the repository

  • source/packages - The ccai.rpc package source

  • source/tests - The unittest based tests for the package

  • workspaces - This is where you add VSCode workspaces templates and where workspaces show up when homed.

References

Metadata

Release files for codecraftai-python-rpc 1.3.0

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

Source distribution (sdist)

Source distribution for codecraftai-python-rpc 1.3.0
File Size Uploaded Provenance
codecraftai_python_rpc-1.3.0.tar.gz 49.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codecraftai-python-rpc 1.3.0
File Interpreter ABI Platform
codecraftai_python_rpc-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 122.1 kB

Release files / codecraftai_python_rpc-1.3.0.tar.gz

Download URL codecraftai_python_rpc-1.3.0.tar.gz
Size 49.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c82f52677f21e4c2e8f1dd802936be68ee36b22b30886f8ac58ddb8668d926eb
BLAKE2b-256 checksum
How to use checksums
09f1a9954748148ba57d48c0ff096c524e183e3228854df2f528db98e504fc33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / codecraftai_python_rpc-1.3.0-py3-none-any.whl

Download URL codecraftai_python_rpc-1.3.0-py3-none-any.whl
Size 72.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
368ad788cb5cbb2bf18690ca1500e70b9fb47e71acea57191bf518ecb2db18be
BLAKE2b-256 checksum
How to use checksums
7fd352daa4fe6cd8e7119d7cd38db0473adc0e11229a0085aac4941ba8e349f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for codecraftai-python-rpc 1.3.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for codecraftai_python_rpc-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files Full provenance

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