Skip to main content

PortaPyC

PortaPyC (pronounced port-a-pike) is a Python 3 port of RPyC 3.3.0 that preserves the RPyC wire protocol. Its primary use case is connecting matching and differing Python runtimes: a Python 3 application can communicate with a legacy Python 2 RPyC server (and vice versa) even when that server cannot be upgraded. Without a compatibility layer, Python 2/3 runtime and data-model differences would normally prevent this connection.

PortaPyC provides transparent, symmetric remote procedure calls: code on one machine can call functions, access objects, and use services on another machine as if they were local. This makes it useful for lightweight distributed computing, remote administration, test control, and integrating new Python 3 applications with systems that still depend on Python 2.

PortaPyC keeps the RPyC programming model while adding Python 3 support. It supports direct TCP connections, SSL-wrapped connections, SSH tunnels, standard-input/output pipes, subprocess and thread helpers, and optional service discovery through a registry.

Installation

python -m pip install portapyc

The package requires Python 3.7 or newer. Install the documentation dependencies with:

python -m pip install "portapyc[docs]"

Cross-version compatibility

Start a classic server on the machine that should expose Python:

rpyc_classic.py --port 18812

Connect to it from a Python 3 client:

import portapyc

connection = portapyc.classic.connect("server.example.com", port=18812)
print(connection.eval("1 + 2"))
print(connection.modules.os.listdir("."))
connection.close()

The same approach works when the PortaPyC endpoint is the server and a compatible Python 2 RPyC client connects to it. Compatibility is based on the RPyC 3.3.0 protocol, not arbitrary combinations of RPyC releases.

Changes compared with RPyC

PortaPyC is based on RPyC 3.3.0, but its implementation is adapted for Python 3 and cross-version communication:

  • A compatibility layer isolates Python 2/3 differences in execution, built-in types, iterators, queues, threads, sockets, and platform polling.
  • The Brine protocol serializer handles Python 2 str/unicode and Python 3 bytes/str representations on the wire.
  • Optional convert_str connection configuration converts received Python 2 byte strings to Python 3 text, or Python 3 text to Python 2 strings, when application-level text conversion is needed.
  • Protocol, proxy, exception, iterator, and pickle handling are kept aligned with the RPyC 3.3.0 protocol so remote objects remain usable across runtimes.
  • The package exposes the familiar RPyC-style API under portapyc, with Python 3 connection factories for TCP, SSL, SSH, pipes, subprocesses, threads, and discovery.

These changes target interoperability with RPyC 3.3.0. They do not make different, unrelated RPyC protocol versions universally compatible.

Quick start

For an application-specific service, connect directly and use the remote root object:

import portapyc

connection = portapyc.connect("server.example.com", 18812)
result = connection.root.calculate_total(10, 20)
connection.close()

Documentation

See this project's documentation on ReadTheDocs or read RPyC's documentation for information about the connection model, service discovery, security options, and the public API reference.

You can also build this project's documentation locally with Sphinx. After installing the documentation dependencies, run the following command in the project root directory to build the HTML documentation:

pip install portapyc[docs]
python -m sphinx -b html docs docs/_build/html

License

PortaPyC is distributed under the MIT license. See LICENSE.

Release files for portapyc 3.3.0.post4

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

Source distribution (sdist)

Source distribution for portapyc 3.3.0.post4
File Size Uploaded
portapyc-3.3.0.post4.tar.gz 58.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for portapyc 3.3.0.post4
File Interpreter ABI Platform
portapyc-3.3.0.post4-py3-none-any.whl Python 3 none any Details

Total release size: 124.8 kB

Release files / portapyc-3.3.0.post4.tar.gz

Download URL portapyc-3.3.0.post4.tar.gz
Size 58.5 kB
Tags Source
SHA-256 checksum
How to use checksums
707b585c03a456148095f49cace5e54a72e1abd1b615083e846915970eaf9e16
BLAKE2b-256 checksum
How to use checksums
3b101b2f3d558a6ec9b75d7965b8bec5659ff746efb8628e5032ce015dc4c6ab
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 16, 2026.

Transparency log

Release files / portapyc-3.3.0.post4-py3-none-any.whl

Download URL portapyc-3.3.0.post4-py3-none-any.whl
Size 66.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57b884843ff7618743b51eec09c1288f9f521b5c55679125d62b5cacba508039
BLAKE2b-256 checksum
How to use checksums
56ad371ef86fce3a193b361d3fd402104987c909842d577f334ca5796e3b2c3d
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.3.0.post4 This release

2 release files

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