Reloadr – Hot code reloading tool for Python

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • jurigged

    Hot reloading for Python

  • `python -m jurigged script.py` or `jurigged script.py` instead of `python script.py` and it will watch everything in the current working directory.

    There's still some bugs I have to iron out, though, it should be better in a month or so. Still, you can pip install it if you want.

    [1] https://github.com/breuleux/jurigged

  • reloadr

    Hot code reloading tool for Python

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • PyDev.Debugger

    Sources for the debugger used in PyDev, PyCharm and VSCode Python

  • Ha, I'm just working on integrating the `pydev.debugger` code reloading into `debugpy` (so that the code reloading from the PyDev debugger will be available for Python-VSCode debugger users too).

    The in-memory reloading (which may be seen at: https://github.com/fabioz/PyDev.Debugger/blob/main/_pydevd_b...) unfortunately doesn't work all the time (fixing the references at runtime in Python is difficult), but it works well enough for the cases where you have a simple function and change it (that file does explain some of the issues that the reloading faces).

    One major issue is that after doing the reload, you need to get out of the function and then back into it to see the difference -- so, if you're stopped in the function in a breakpoint, it's not possible to simply drop the function and restart it as Python itself doesn't support that... maybe that's a good idea for a PEP ;)

    Anyways, when it works, it's pretty nice in that you don't have to restart your whole debug session to see changes (the other approach, which webservers use in general is just restart the whole process, so, for instance, Django has an initial process just monitoring for changes and a 2nd process which is actually serving requests which is restarted when something changes -- not as good if you have a heavy startup or are working with something where you have to click through multiple things to get to the state which you want).

  • ipdb

    Integration of IPython pdb

  • Now tie in some ipdb [1] and you have a pretty sweet setup. Also depending on your serving framework it might also have hot reloading as well, tornado, flask, etc.

    [1]https://github.com/gotcha/ipdb

    [2] https://www.tornadoweb.org/en/stable/autoreload.html https://werkzeug.palletsprojects.com/en/0.14.x/serving/

  • RuntimeCompiledCPlusPlus

    Change C++ code at runtime

  • There is https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledC...

    The idea is to use virtual functions, and recompile new classes into a shared library. The shared lib is linked into the running program, and old instances of the classes are deleted and replaced by new instances constructed from the share library.

    I am working on a library using the same (stolen) idea here:

    https://github.com/jheruty/hscpp

    Proof of concept demo:

    https://m.youtube.com/watch?v=pjGngeKgni8

    hscpp is still very alpha, and I’m sure I’ll find lots of bugs as I work on a “real” demo. In contrast, Runtime Compiled C++ is quite mature and is used in real game projects.

    Note that this approach very much limits your architecture. For example, you won’t be able to use statics, as the newly compiled shared libraries won’t see them.

    It’s a finicky thing, worth it to me, but not something you can just plop in to an established project.

  • PythonHotswap

    Hotswap Python functions. And persistence of runtime.

  • - https://github.com/albertz/PythonHotswap

  • ipython

    Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.

  • - https://github.com/ipython/ipython/blob/f8c9ea7db42d9830f163...

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • pyqtboiler

    PyQt application boilerplate for rapid development

  • - https://github.com/mikr/pyqtboiler/blob/master/baseapp/utils...

  • hotpatch

    In-place hotpatching for Python functions

  • - https://github.com/mpolney/hotpatch

  • hottie

    python code hot-swapping

  • - https://github.com/narfdotpl/hottie with decorator

  • inquest

    Discontinued Inquest lets you add log statements to python without restarting your python instance. It helps you quickly uncover what is going wrong.

  • - https://github.com/yiblet/inquest

  • reloading

    Change Python code while it's running without losing state

  • Write a similar thing [1] which can also reload functions from source before every execution but also load loop bodies from source before each iteration. Can be helpful for long running loops like when downloading or training deep learning models.

    [1] https://github.com/julvo/reloading

  • Revise.jl

    Automatically update function definitions in a running Julia session

  • In Julia, this can be done with even less efforts on the user-side by loading Revise (https://github.com/timholy/Revise.jl) before any other package you load.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts