{"id":22794923,"url":"https://github.com/pulkin/pyteleport","last_synced_at":"2025-04-19T06:35:39.399Z","repository":{"id":106307469,"uuid":"378733073","full_name":"pulkin/pyteleport","owner":"pulkin","description":"Snapshot, transmit, and resume python states","archived":false,"fork":false,"pushed_at":"2024-02-11T22:25:11.000Z","size":458,"stargazers_count":22,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"dev","last_synced_at":"2025-03-29T06:51:17.560Z","etag":null,"topics":["aws","bytecode","python","ssh"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pulkin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-20T20:20:51.000Z","updated_at":"2024-11-30T22:11:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b53be32-ecf0-44b1-a68d-c4b34990d25d","html_url":"https://github.com/pulkin/pyteleport","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulkin%2Fpyteleport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulkin%2Fpyteleport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulkin%2Fpyteleport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulkin%2Fpyteleport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pulkin","download_url":"https://codeload.github.com/pulkin/pyteleport/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249629141,"owners_count":21302778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","bytecode","python","ssh"],"created_at":"2024-12-12T04:11:04.210Z","updated_at":"2025-04-19T06:35:39.361Z","avatar_url":"https://github.com/pulkin.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![build](https://github.com/pulkin/pyteleport/actions/workflows/test.yml/badge.svg)](https://github.com/pulkin/pyteleport/actions)\n[![pypi](https://img.shields.io/pypi/v/pyteleport)](https://pypi.org/project/pyteleport/)\n\n# ![icon](resources/icon-full.svg)\n\nA proof-of-concept serialization, transmission and restoring python runtime.\n\nAbout\n-----\n\n`pyteleport` is capable of making snapshots of python runtime from\n(almost) aribtrary state, including locals, globals and stack.\nIt then transforms snapshots into specially designed bytecode that\nresumes execution from the snapshot state.\nThe bytecode can be run remotely: this way `pyteleport` teleports\npython runtime.\n\nInstall\n-------\n\n```\npip install pyteleport\n```\n\nExample\n-------\n\n![term cast 0](resources/cast0.gif)\n\nNote that the two outputs were produced by different processes on different machines! This is what\n`tp_bash` does: it transmits the runtime from one python process to another (remotely).\n\nAlso works from within a stack:\n\n```python\ndef a():\n    def b():\n        def c():\n            result = \"hello\"\n            tp_bash(...)\n            return result + \" world\"\n        return len(c()) + float(\"3.5\")\n    return 5 * (3 + b())\nassert a() == 87.5\n```\n\nAPI\n---\n\nTBD, see docstrings for the moment\n\nHow it works\n------------\n\n* You invoke `teleport` in your python script.\n* `pyteleport` collects the runtime state: globals, locals, stack.\n* `pyteleport` dumps the runtime into a specially designed \"morph\" bytecode\n  which resumes from a state resembling current runtime state.\n* The bytecode is transmitted to the target environment and passed to a\n  python interpreter there.\n* The remote python runs the bytecode which restores the runtime state.\n  The python program casually resumes from where it was interrupted.\n* The local python runtime is terminated and simply pipes stdio from the\n  target environment.\n\nKnown limitations\n-----------------\n\nThis is a proof of concept.\nThe package works with cPython ~~v3.8~~, 3.9, or 3.10.\n\nCurrent limitations:\n\n- [ ] no thread support\n- [ ] no `async` support (needs further investigation regarding non-python stack)\n- [ ] more generally, no native code support\n- [ ] back-teleport and nested teleport (never tried)\n\nLicense\n-------\n\n[LICENSE.md](LICENSE.md)\n\nUseful information\n------------------\n\n- [Experimenting with AWS](doc/aws.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulkin%2Fpyteleport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulkin%2Fpyteleport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulkin%2Fpyteleport/lists"}