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
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.5.tar.gz
(23.7 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.5-py3-none-any.whl
(22.0 kB
view details)
File details
Details for the file runce-0.1.5.tar.gz.
File metadata
- Download URL: runce-0.1.5.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
383385926ba36b41607d3c34ff20b3a7e26803a0c471448124c726094d19d892
|
|
| MD5 |
ef819a2c29a09b9a6a86928d7852e5d3
|
|
| BLAKE2b-256 |
a1f4927275c4d41d296c491d1eee70680ece0aa5c05e964199029e7dff29f482
|
File details
Details for the file runce-0.1.5-py3-none-any.whl.
File metadata
- Download URL: runce-0.1.5-py3-none-any.whl
- Upload date:
- Size: 22.0 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 |
ec6f6fe2ec877923e66fa904aa7b980d06ed63119667ee32826843127a3a8c18
|
|
| MD5 |
78b9f87e058ff7295136a1f203b4c407
|
|
| BLAKE2b-256 |
9aacdb415af2508f4dc0dce28cc8320b5651f501b4116bd89e3d318e675c389b
|