A lightweight Python-native service manager.
Project description
konstant
A lightweight Python process manager for Windows. Think PM2 but Python-native and without the Node dependency.
Features
- Manage long-running Python processes via a simple CLI
- Automatic restart with configurable backoff protection
- Log capture with rotation
- Optional Windows service registration (survives reboots)
- No daemon required — state is stored in flat JSON files
Installation
pip install -e .
Quick Start
- Create a
konstant.tomlin your working directory:
[services.my-worker]
script = "worker.py"
interpreter = "python"
cwd = "C:/projects/myapp"
env_file = ".env"
autorestart = true
max_restarts = 10
restart_delay = 5
- Start your services:
konstant start # start all services
konstant start my-worker # start a specific service
CLI Commands
konstant start [name] Start service(s)
konstant stop [name] Stop service(s)
konstant restart [name] Restart service(s)
konstant status [name] Show pid, uptime, restart count, status
konstant logs [name] Tail logs (default: last 50 lines)
konstant logs [name] --follow Stream logs live
konstant install [name] Register as Windows service (survives reboot)
konstant uninstall [name] Remove Windows service registration
Configuration
See konstant.toml for all available options:
| Key | Type | Default | Description |
|---|---|---|---|
script |
str | required | Path to the Python script to run |
interpreter |
str | "python" |
Python interpreter to use |
cwd |
str | "." |
Working directory for the process |
env_file |
str | "" |
Path to a .env file to load |
autorestart |
bool | true |
Restart on crash |
max_restarts |
int | 10 |
Max restarts within a 60s window |
restart_delay |
int | 5 |
Seconds to wait before restarting |
args |
list | [] |
Extra arguments passed to the script |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
konstant-0.1.0.tar.gz
(11.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
konstant-0.1.0-py3-none-any.whl
(13.3 kB
view details)
File details
Details for the file konstant-0.1.0.tar.gz.
File metadata
- Download URL: konstant-0.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e095759a3f4298cd7ed4ff7a1b2485d084fff63ab38e7518fb3d1bf920782a57
|
|
| MD5 |
7dc45731f972de681e28a522b8bbb50f
|
|
| BLAKE2b-256 |
65879e9b39a9abf69a8d60536f50482c78a94fa7a4134b5583798f55d4daf081
|
File details
Details for the file konstant-0.1.0-py3-none-any.whl.
File metadata
- Download URL: konstant-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e71a0ddd1a5d817a62a992a0928229cfbbc38bc2a68218b943f9f633bd38474a
|
|
| MD5 |
ab657401ecce68e7ed4803b81c79b060
|
|
| BLAKE2b-256 |
52327c6ba8537d14385d061e3e539f88beccd0baa38c29b7446184ca7da18513
|