Skip to main content

Hot code reloading tool for Python

Project description


Python hot code reloading tool.

pip install reloadr


You can simply decorate your functions / classes with @reloadr and you are ready to go.

from reloadr import reloadr

def do_something(a, b):
    return a + b

class SomeThing:
    def do_stuff(self):

Then, to reload the code, you can use of the following:

# Manual reload

# Automatic reload using system (requires library 'watchdog')

# Automatic reload in a thread every 1 second


Launch an example (they each contain an infinite loop), then change the source code of the decorated class or function.

git clone

python examples/

How it works

Instead of importing your source file again, which can lead to undesired side effects, Reloadr fetches the new code of your function within the Python source file, and executes that code in the environment of your already loaded module.

This allows it to reload code that is followed by blocking instructions such as the infinite loops you can find in the examples.

To achieve this, Reloadr relies on RedBaron , an great tool for manipulating Python source code.

Future plans

This project is still in its early stages. All ideas for improvement are welcome.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Reloadr, version 0.3.3
Filename, size File type Python version Upload date Hashes
Filename, size Reloadr-0.3.3-py3-none-any.whl (7.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size Reloadr-0.3.3.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page