A process supervisor with execution control based on system resource state.
Project description
FortScript
A process supervisor with execution control based on system resource state.
Table of Contents
FortScript is a Python Process Manager, based on RAM monitoring and OS process detection, that automatically starts, pauses, and terminates applications using reactive resource consumption policies.
1. The Library
FortScript can be integrated into any Python project as a library to manage child processes and monitor system health.
Installation
pip install fortscript
Quick Start
from fortscript import FortScript
# Initialize with a configuration file
app = FortScript(config_path="my_config.yaml")
# Run the management loop
app.run()
Why use the library?
- Clean Lifecycle: Safely start and stop child processes (including full process trees).
- Resource Monitoring: Built-in hooks for RAM usage and process activity.
- Multi-Runtime: Supports Python, Node.js (pnpm), and native Executables.
1. Managing Independent Modules
You can use FortScript as a central controller for various scripts scattered across your system.
config.yaml:
# List of projects to be managed
projects:
- name: "Trading Bot"
path: "C:/Users/Dev/Finance/bot.py"
- name: "Server Monitor"
path: "C:/Users/Dev/Server/monitor.js"
# Processes that, when detected, will pause your projects
heavy_processes:
- name: "Fortnite"
process: "fortnite"
- name: "Video Editor"
process: "resolve"
# RAM usage percentage threshold to trigger safe shutdown
ram_threshold: 90
2. Integration in Larger Projects
Import FortScript in your main application entry point to automatically handle background tasks.
# main_controller.py
from fortscript import FortScript
def start_services():
# Detects games/heavy apps and pauses these services automatically
manager = FortScript(config_path="./services_config.yaml")
manager.run()
Configuration Options
The config.yaml file supports the following fields:
| Field | Description | Type | Default |
|---|---|---|---|
projects |
List of applications to manage. Each item needs a name and path. |
List | [] |
heavy_processes |
List of processes that trigger a pause. Each item needs a name and process (substring of the executable name). |
List | [] |
ram_threshold |
Maximum RAM usage percentage allowed before stopping scripts. | Integer | 80 |
2. CLI
The CLI is an interface designed for a broad audience, allowing for easy process management.
Usage
If you are developing locally:
uv run fort
After installation, simply run:
fort
- Configuration: The CLI looks for a
config.yamlfile in the same directory as the script. - Auto-detection: Soon, it will be possible to add the main initialization script to the CLI by running a single command inside the project folder.
Roadmap & Features
The following list tracks the progress of our features and future implementations:
- Monitor Heavy Processes: Detection of resource-intensive applications.
- RAM Usage Monitoring: Automatic triggers based on memory percentage.
- Unified Script Runner:
- Native Executables (
.exe) - Python Scripts (
.py) - JavaScript/TypeScript Projects (
package.json)
- Native Executables (
- System Integration:
- Auto-start with Windows/Linux.
- System Tray (Icon) support for background operation.
- Smart Interruption:
- Auto-stop when heavy processes are detected.
- Auto-resume when processes are closed.
- RAM-based stop/resume cycling.
Contributing
Contributions are welcome! Please read our Contribution Guide for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Developed with ❤️ by WesleyyDev
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file fortscript-0.2.1.tar.gz.
File metadata
- Download URL: fortscript-0.2.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d8fb9c079c116f80b52bd070e43a7a0b8f25cc175d3c08e19432dc8fd85be5
|
|
| MD5 |
53a054c44999f31dafb90ca10aedabe2
|
|
| BLAKE2b-256 |
a13c59ff6dbe5ec9ad3452945939f718ccfa576d72419f83e83f9d271372eda4
|
Provenance
The following attestation bundles were made for fortscript-0.2.1.tar.gz:
Publisher:
release.yml on WesleyQDev/fortscript
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fortscript-0.2.1.tar.gz -
Subject digest:
67d8fb9c079c116f80b52bd070e43a7a0b8f25cc175d3c08e19432dc8fd85be5 - Sigstore transparency entry: 773849613
- Sigstore integration time:
-
Permalink:
WesleyQDev/fortscript@1bb17b10ce2627349fab066eb2035270c8347f39 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/WesleyQDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1bb17b10ce2627349fab066eb2035270c8347f39 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fortscript-0.2.1-py3-none-any.whl.
File metadata
- Download URL: fortscript-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b407c619af7bff543caf8ad058336d9f1bab367882b9027943b0a2f75b177e8
|
|
| MD5 |
880dbe2d83184f21fa4d86f9f7db8be3
|
|
| BLAKE2b-256 |
cfe4c002c227bfb446a7ef63fbfaabdf93991b5271e2ed532cd8993a53ccc54a
|
Provenance
The following attestation bundles were made for fortscript-0.2.1-py3-none-any.whl:
Publisher:
release.yml on WesleyQDev/fortscript
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fortscript-0.2.1-py3-none-any.whl -
Subject digest:
9b407c619af7bff543caf8ad058336d9f1bab367882b9027943b0a2f75b177e8 - Sigstore transparency entry: 773849645
- Sigstore integration time:
-
Permalink:
WesleyQDev/fortscript@1bb17b10ce2627349fab066eb2035270c8347f39 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/WesleyQDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1bb17b10ce2627349fab066eb2035270c8347f39 -
Trigger Event:
push
-
Statement type: