Skip to main content

build pypi

icon

A proof-of-concept serialization, transmission and restoring python runtime.

About

pyteleport is capable of making snapshots of python runtime from (almost) aribtrary state, including locals, globals and stack. It then transforms snapshots into specially designed bytecode that resumes execution from the snapshot state. The bytecode can be run remotely: this way pyteleport teleports python runtime.

Install

pip install pyteleport

Example

term cast 0

Note that the two outputs were produced by different processes on different machines! This is what tp_bash does: it transmits the runtime from one python process to another (remotely).

Also works from within a stack:

def a():
    def b():
        def c():
            result = "hello"              # runs locally
            tp_bash(...)                  # teleport here
            return result + " world"      # runs remotely
        return len(c()) + float("3.5")    # c() runs locally, then remotely; the rest runs remotely
    return 5 * (3 + b())                  # b() runs locally, then remotely; sum and product run remotely
assert a() == 87.5                        # a() runs locally, then remotely; == and assert run remotely

API

TBD, see docstrings for the moment

How it works

  • You invoke teleport in your python script.
  • pyteleport collects the runtime state: globals, locals, stack.
  • pyteleport dumps the runtime into a specially designed "morph" bytecode which resumes from a state resembling current runtime state.
  • The bytecode is transmitted to the target environment and passed to a python interpreter there.
  • The remote python runs the bytecode which restores the runtime state. The python program casually resumes from where it was interrupted.
  • The local python runtime is terminated and simply pipes stdio from the target environment.

Known limitations

This is a proof of concept. The package works with cPython v3.8, 3.9, 3.10, 3.11, or 3.12.

Current limitations:

  • no thread support
  • no async support (needs further investigation regarding non-python stack)
  • more generally, no native code support
  • back-teleport and nested teleport (never tried)

License

LICENSE.md

Useful information

Metadata

Release files for pyteleport 0.3.0.post1

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

Source distribution (sdist)

Source distribution for pyteleport 0.3.0.post1
File Size Uploaded
pyteleport-0.3.0.post1.tar.gz 32.4 kB Details

Release files / pyteleport-0.3.0.post1.tar.gz

Download URL pyteleport-0.3.0.post1.tar.gz
Size 32.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3302ab078cfcd8b1afcfd263a7c82b69ea05302b2360716e997886fea1a20f11
BLAKE2b-256 checksum
How to use checksums
4d7ed67121b842ce1fdfd9480bc60383c637245d24d43d1a7ea8271d20bcf163
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 Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.2

1 release file

0.3.1

1 release file

This release

0.3.0.post1 This release

1 release file

0.2

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

0.0

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