daemonizer
Light-weight and easy-to-use Python package that simplifies the process of daemonizing Python applications,
allowing them to run in the background as standalone logics
It offers a programmatic way or CLI-first interface for developers, without using system-wise solutions like services.
Features
- Simple API to daemonize any Python function or class
- Automatic handling of process management (PID files, logging, etc.)
- Support for start, stop, restart, and status operations
- Signal handling (SIGTERM, SIGINT, etc.)
- Compatible with UNIX-like systems
- Python 3.7+ support
Getting started
- Add
daemonizerto your project
or via pip: pip install daemonizer-py.
- Define your daemon logic in a simple Python script
sample.py:
- Interact with it either via the
daemonizerCLI
or directly via SDK handler (directly from Python scripts)
| Daemon handler | |
|---|---|
Note
Multiple daemons can be defined in a single file and multiple daemons can be managed under a single daemon handler (DaemonHandler instance).