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.7.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.7-py3-none-any.whl
(22.2 kB
view details)
File details
Details for the file runce-0.1.7.tar.gz.
File metadata
- Download URL: runce-0.1.7.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 |
4b2174f64fb892a6ba70089139fe20763aec7052c22a0a649bab81e58a8cbb49
|
|
| MD5 |
c05dfdc010d1edd5aabd825f5821bb41
|
|
| BLAKE2b-256 |
ddb42b94a979df985127bb94f21ee80b6d4f722d85648ebc6c3345c4ac266a42
|
File details
Details for the file runce-0.1.7-py3-none-any.whl.
File metadata
- Download URL: runce-0.1.7-py3-none-any.whl
- Upload date:
- Size: 22.2 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 |
3631b630e596c4cc60083a1e73ac4f1a39bbb44d02f675ddb621282ab2c94747
|
|
| MD5 |
1a6026b0ea7f418716d196c58f6769ec
|
|
| BLAKE2b-256 |
b8afd4a70b7ee759ca8273457d130f0abeace0b370631e79cc70e39e866c18a4
|