A proof-of-concept serialization, transmission and restoring python runtime.
About
pyteleport is capable of making snapshots of python runtime from
(almost) arbitrary 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
Teleport inside REPL:
>>> result = "something important"
>>> from pyteleport import tp_bash
>>> tp_bash("ssh", "remote")
>>> print(result) # REPL is now running on a remote machine with all data available
Also works from anywhere in the 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
pyteleport.tp_bash(*args), pyteleport.tp_shell(*args)
A PoC transfer of python runtime state: just specify how to reach the remote
shell and pyteleport will do the rest for you.
pyteleport.dump("filename.pyc")
Save the current runtime state as a snapshot.pyc file.
You may then resume or replay your python program from the snapshot state
by simply running python snapshot.pyc.
How it works
- You invoke
teleportin your python script. pyteleportcollects the runtime state: globals, locals, stack.pyteleportdumps the runtime into a specially designed "morph" bytecode.- The bytecode is transmitted to the target environment and passed to a python interpreter there.
- The remote python runs the bytecode which (1) develops the runtime state into the snapshot and (2) resumes running.
- The local python runtime pipes the stdio of the remote process or resumes independently (fork mode).
Known limitations
This is a proof of concept. The package works with cPython 3.9-3.14.
Current limitations:
- no thread support
- no
asyncsupport (needs further investigation regarding non-python stack) - more generally, no native code support
- back-teleport and nested teleport (never tried)
License
Useful information
Metadata
Release files for pyteleport 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyteleport-0.3.4.tar.gz | 37.9 kB | With provenance | Details for pyteleport-0.3.4.tar.gz |
Release files / pyteleport-0.3.4.tar.gz
| Download URL | pyteleport-0.3.4.tar.gz |
|---|---|
| Size | 37.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d83ccafb225634d1bc3446c4d600039404406cc89517d06749d912159f921603
|
|
BLAKE2b-256 checksum How to use checksums |
56dda9c6f8b8b96bd8de2643ca41d4bbc23013386d8ab7b63210eec4a69e67b2
|
| 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 18, 2026.
Transparency logSecurity for pyteleport 0.3.4
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
1 file in this release has been uploaded with provenance metadata.
Attestation for pyteleport-0.3.4.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 18, 2026.
Transparency logA 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.