Skip to main content

No project description provided

Project description

This project exposes one function – with_reloading – which is used to run a single callable. This callable gets run in a separate thread which gets restarted whenever a Python source file from the current working directory down changes. This improves the development cycle by removing the need to manually restart long running services whenever its source code changes.

> Burgeon: To grow or develop rapidly; expand or proliferate.

Installation

pip install burgeon

Example Usage

from burgeon import with_reloading


def my_function():
    while True:
        print("hello")

with_reloading(my_function)

The function above demonstrates a minimal example of using with_reloading. Once the code is executed, any changes to the file (that get saved) will notify burgeon to restart the thread running the function and execute the new changes.

Acknowledgements

This implementation of Python file reloading uses watchgod and is heavily based off the BaseReload class in the uvicorn repository. For context, this is how uvicorn implements its own development server reloading. This project simplifies the implementation and exposes the reloading functionality via a simple and opinionated interface.

Project details


Download files

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

Source Distribution

burgeon-0.1.3.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

burgeon-0.1.3-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page