Ensure only one instance of your process runs at a time.
Project description
Runce
🚀 The One-and-Done Process Wrangler
"Runce and done! No repeats, no retreats!" 🏃♂️💨
🔒 Guaranteed Singleton Execution • 📊 Process Tracking • ⏱️ Lifecycle Management
☕ Support
If you find this project helpful, consider supporting me:
Features ✨
- 🚫 No Duplicates: Each command runs exactly once per unique ID
- 📝 Process Tracking: View all managed processes with status
- ⏱️ Execution Time: Track how long processes have been running
- 📂 Log Management: Automatic stdout/stderr capture
- 🛑 Clean Termination: Proper process killing
Installation 📦
pip install runce
Usage 🛠️
# Run a singleton process
runce run --id my-process -- python script.py
# List all processes
runce list
# View output
runce tail my-process -n 20
# Stop a process
runce kill my-process
# Restart a process
runce restart my-process
# Clean dead processes
runce clean
Examples 💡
1. Running a Background Service
runce run --id api-server -- python api.py
2. Checking Running Processes
$ runce list
PID NAME STATUS ELAPSED COMMAND
1234 api-server ✅ Running 01:23:45 python api.py
5678 worker ❌ Stopped 00:45:30 python worker.py
3. Preventing Duplicates
$ runce run --id daily-job -- python daily.py
🚀 Started: PID:5678(✅ Running) daily-job
$ runce run --id daily-job -- python daily.py
🚨 Already running: PID:5678(✅ Running) daily-job
How It Works ⚙️
- Process Locking: Each
--idcreates a lock file - PID Tracking: Running processes are tracked in JSON files
- Singleton Enforcement: Duplicate execution prevented
- Cleanup: Dead processes can be automatically cleaned
Development 🏗️
# Install in development mode
pip install -e .
# Run tests
pytest
# Lint code
flake8 runce
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
runce-0.1.8.tar.gz
(24.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
runce-0.1.8-py3-none-any.whl
(22.1 kB
view details)
File details
Details for the file runce-0.1.8.tar.gz.
File metadata
- Download URL: runce-0.1.8.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80a41ab89e16151bbedfb900fdcaf213c32897da43c9f2fcb50a7f89e6ab03c3
|
|
| MD5 |
f2f7f9e6e09899f505903d2629afbf3e
|
|
| BLAKE2b-256 |
65daa6b7636ecafaa293bd4faa93cc5c38f50ea5a3d8d2a177302a9485eaf970
|
File details
Details for the file runce-0.1.8-py3-none-any.whl.
File metadata
- Download URL: runce-0.1.8-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7070cec97250e0328bcb15815e678048cecfade2e0d37b8ee984d943fe057d90
|
|
| MD5 |
cf7b6c4e8d4bd3b1747686469ec92d76
|
|
| BLAKE2b-256 |
d9354cb36cb46c98e702c098293c0db3f1b5abb88cc8ed8548348141d80d5e03
|