{"id":13689158,"url":"https://github.com/hoh/reloadr","last_synced_at":"2025-04-04T18:08:39.592Z","repository":{"id":57461016,"uuid":"48190149","full_name":"hoh/reloadr","owner":"hoh","description":"Hot code reloading tool for Python","archived":false,"fork":false,"pushed_at":"2020-02-12T12:34:18.000Z","size":24,"stargazers_count":530,"open_issues_count":9,"forks_count":12,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-28T17:11:24.221Z","etag":null,"topics":["developer-tools","development","live-coding","live-reload","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hoh.png","metadata":{"files":{"readme":"README.rst","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":"2015-12-17T18:06:51.000Z","updated_at":"2025-01-03T23:48:07.000Z","dependencies_parsed_at":"2022-09-17T04:30:52.287Z","dependency_job_id":null,"html_url":"https://github.com/hoh/reloadr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoh%2Freloadr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoh%2Freloadr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoh%2Freloadr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoh%2Freloadr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoh","download_url":"https://codeload.github.com/hoh/reloadr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"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":["developer-tools","development","live-coding","live-reload","python"],"created_at":"2024-08-02T15:01:35.942Z","updated_at":"2025-04-04T18:08:39.553Z","avatar_url":"https://github.com/hoh.png","language":"Python","readme":"Reloadr\n=======\n\nPython hot code reloading tool.\n\n``pip install reloadr``\n\nUsage\n=====\n\nYou can simply decorate your functions / classes with ``@autoreload`` and\nyou are ready to go.\n\n.. code:: python\n\n    from reloadr import autoreload\n\n    @autoreload\n    def do_something(a, b):\n        return a + b\n\n    @autoreload\n    class SomeThing:\n        def do_stuff(self):\n            pass\n\nAdvanced usage\n==============\n\nTo reload the code manually, you can use of the following:\n\n.. code:: Python\n\n    from reloadr import reloadr\n\n    @reloadr\n    class SomeThing:\n        def do_stuff(self):\n            pass\n\n    # Manual reload\n    SomeThing._reload()\n\n    # Automatic reload using filesystem notifications\n    SomeThing._start_watch_reload()\n\n    # Automatic reload in a thread every 1 second\n    SomeThing._start_timer_reload(1)\n\nExamples\n========\n\nLaunch an example (they each contain an infinite loop), then change the\nsource code of the decorated class or function.\n\n``git clone https://github.com/hoh/reloadr.git``\n\n``python examples/01_manual_reload.py``\n\nHow it works\n============\n\nInstead of importing your source file again, which can lead to undesired side\neffects, Reloadr fetches the new code of your function within the Python source\nfile, and executes that code in the environment of your already loaded module.\n\nThis allows it to reload code that is followed by blocking instructions such\nas the infinite loops you can find in the examples.\n\nTo achieve this, Reloadr relies on  `RedBaron\n\u003chttps://github.com/psycojoker/redbaron/\u003e`_ , an great tool for manipulating\nPython source code.\n\nFuture plans\n============\n\nThis project is still in its early stages. All ideas for improvement are welcome.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoh%2Freloadr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoh%2Freloadr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoh%2Freloadr/lists"}