{"id":13696728,"url":"https://github.com/devopspp/pyliveupdate","last_synced_at":"2026-01-14T10:21:41.999Z","repository":{"id":62581437,"uuid":"235950362","full_name":"devopspp/pyliveupdate","owner":"devopspp","description":"A runtime python code manipulation framework for profiling, debugging and bugfixing","archived":false,"fork":false,"pushed_at":"2022-08-22T05:47:00.000Z","size":152,"stargazers_count":65,"open_issues_count":4,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-30T13:19:21.853Z","etag":null,"topics":["debugging","instrumentation","monkey-patching","patching","profiling","python","zero-downtime"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devopspp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-24T06:19:28.000Z","updated_at":"2025-06-11T02:22:37.000Z","dependencies_parsed_at":"2022-11-03T22:01:09.590Z","dependency_job_id":null,"html_url":"https://github.com/devopspp/pyliveupdate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devopspp/pyliveupdate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopspp%2Fpyliveupdate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopspp%2Fpyliveupdate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopspp%2Fpyliveupdate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopspp%2Fpyliveupdate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devopspp","download_url":"https://codeload.github.com/devopspp/pyliveupdate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopspp%2Fpyliveupdate/sbom","scorecard":{"id":338156,"data":{"date":"2025-08-11","repo":{"name":"github.com/devopspp/pyliveupdate","commit":"a5772507bc37cbe0dff962bf28edcb775348ca31"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T05:12:39.673Z","repository_id":62581437,"created_at":"2025-08-18T05:12:39.673Z","updated_at":"2025-08-18T05:12:39.673Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:18:03.274Z","status":"ssl_error","status_checked_at":"2026-01-14T10:16:11.865Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["debugging","instrumentation","monkey-patching","patching","profiling","python","zero-downtime"],"created_at":"2024-08-02T18:00:45.790Z","updated_at":"2026-01-14T10:21:41.976Z","avatar_url":"https://github.com/devopspp.png","language":"Python","readme":"# PyLiveUpdate\n`PyLiveUpdate` is tool to help you modify your running python code without stopping it.\nIt is useful for modifying long-running server programs in production with zero downtime.\nSome modification scenario includes: inject code to profile the runtime of certain lines of code;\ninject code to print out a variable for debugging; apply a patch without restarting.\n\n## Install\n\n```\npip install pyliveupdate\n```\n\n## How to use\nPut these two lines of code in your server program and run it. Try it out with `example/program1.py`. \n```\nfrom pyliveupdatescripts import UpdateStub\nUpdateStub().start()\n```\nStart a controller to modify it!\n```\n\u003e pylu-controller -l 127.0.0.1:50050\n```\nSome predefined modification available in the controller\n```\n\u003e FuncProfiler.profile(['__main__.**', 'module1.**']) # inject execution time profiling code into all functions in __main__ and module1\n\u003e LineProfiler.profile('__main__.bar', [11, 12]) # inject time profiling code into certain lines\n\u003e FuncDebugger.debug('__main__.bar') # inject code to print out function parameter and return value\n\u003e LineDebugger.debug('__main__.bar', [11, 12]) # inject code to print out variables in certain lines\n\u003e VarDebugger.debug('__main__.bar', 'b') # inject code to print out all values of a variable in different statements\n```\n\nThese will print out corresponding profiling and debugging info in the program terminal and in `/tmp/pyliveupdate`.\nYou can also define your own customized modifications.\n\n## Customized modification\nThere are in general two kinds of modification: instrument and redefine.\nYou can define them as following and apply with `patch('patch.py')`. Try it out with `example/patch.py`.\n\n#### Instrument code into existing functions\n```\nfrom pyliveupdate.update import Instrument, UpdateManager\n\ndef _line_after(a):\n    print(a)\n    \nupdate = Instrument('__main__.bar', \n                    {('line_after', [12, 14]): _line_after})\nUpdateManager.apply_update(update)\n```\nThe code injects a `print(a)` in line 12 and 14 in function `__main__.bar`.\n#### Redefine (patch) existing functions\n```\nfrom pyliveupdate.update import Redefine, UpdateManager\n\ndef new_bar(a):\n    print('new_bar', a)\n    \nupdate = Redefine('__main__', None, {'__main__.bar':new_bar})\nUpdateManager.apply_update(update)\n```\nThe code redefines `__main__.bar` with `new_bar`.\n\n## Revert the modification\nPyLiveUpdate also support to revert a modification on the fly:\n```\n\u003e LU.ls() # list all modification\n\u003e LU.revert(1) # revert modifation with id 1\n```\n## Extended tools\nPyLiveUpdate also comes with some handy tools based on it:\n\n### Profiler\nDynamically choose functions or lines to profile and show the result with a flamegraph.\n1. Start your program with PyLiveUpdate enabled, like `example/patch.py`.\n2. Start a controller `pylu-controller -l 127.0.0.1:50050`\n3. Start profiling functions with `FP.profile(['__main__.**', 'module1.**'])` or lines with `LineProfiler.profile('__main__.bar', [11, 12])`.\n4. Process the logs with `pylu-processlogs -i /tmp/pyliveupdate.log` in another terminal\nIt will generated a flamegraph and a summary:\n\n#### Flamegraph\n![alt text](examples/pyliveupdate.log.svg)\n\n#### Function call summary\nThe following summary gives in process `4510` thread `5`, `views.results` was called `10` times and each time takes `139 ms`, `views.results` called `manager.all` for `20` times.\n```\n4510-Thread-5\nfunction  hit  time/hit (ms)\nviews.results 10  138.562\n  -manager.all 20  14.212\n    -__init__.__hash__ 10  0.035\n    -manager.get_queryset 20  0.922\n      -query.__init__ 20  0.616\n        -query.__init__ 20  0.071\n```\n\n## Citation\nPlease kindly cite our work as follows if you want to refer to it in any writing:\n\n```\n@inproceedings{huang2021pylive,\n  title={$\\{$PYLIVE$\\}$:$\\{$On-the-Fly$\\}$ Code Change for Python-based Online Services},\n  author={Huang, Haochen and Xiang, Chengcheng and Zhong, Li and Zhou, Yuanyuan},\n  booktitle={2021 USENIX Annual Technical Conference (USENIX ATC 21)},\n  pages={349--363},\n  year={2021}\n}\n```\n","funding_links":[],"categories":["3. Application"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopspp%2Fpyliveupdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevopspp%2Fpyliveupdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopspp%2Fpyliveupdate/lists"}