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.6.tar.gz
(24.0 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.6-py3-none-any.whl
(22.1 kB
view details)
File details
Details for the file runce-0.1.6.tar.gz.
File metadata
- Download URL: runce-0.1.6.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
329fba87003017ca02e3f55b93542a88774807b96e6b51ff56836f14912fce1b
|
|
| MD5 |
dad96f5e03f5327c95f433c88e1fb5c7
|
|
| BLAKE2b-256 |
9f5d62b1dbe9cdabaa04dacdc919b7305ed2937ddc4f0e4285de2c7264533a41
|
File details
Details for the file runce-0.1.6-py3-none-any.whl.
File metadata
- Download URL: runce-0.1.6-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 |
44bab73a86daa527a0a2a23bbbae801e5b27cd34c85a7a01d4cafa3939c5fc6f
|
|
| MD5 |
f80664e0582ff35aa33246c0e3487cd3
|
|
| BLAKE2b-256 |
0deede928939b81955921a1edd5904687b2a99a4400206c303353fbe1c3d3147
|