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.
1. Python Library
FortScript can be integrated into any Python project as a library to manage child scripts.
You can use FortScript to start scripts and stop them when a certain amount of RAM is used. Or when a specific application/process is started.
A use case, for example, would be to use the library to create a Gaming Mode, where within your project you can define scripts that will be paused when specific games are started and resumed when the games are closed.
Installation
FortScript was developed using UV. We recommend using UV to install the library.
uv add fortscript
If you are using standard Python, you can install the FortScript library with pip.
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 (part 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 applications that consume many resources.
- Monitor RAM Usage: Automatic triggers based on memory percentage.
- Unified Script Executor:
- Native Executables (
.exe) - Python Scripts (
.py) - JavaScript/TypeScript Projects (
package.json)
- Native Executables (
- System Integration:
- Auto-start with Windows/Linux.
- System Tray (icon in the taskbar) for background operation.
- Smart Interruption:
- Automatic stop when heavy processes are detected.
- Automatic resume when processes are closed.
- Stop/resume cycle based on RAM.
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.3.tar.gz.
File metadata
- Download URL: fortscript-0.2.3.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
407fca0b8ed01786bf6d2a68921b34c4280164430609679d56651e2381e52d95
|
|
| MD5 |
c6a424dfc472114f8e9262d8625596be
|
|
| BLAKE2b-256 |
517adeb9b6d95e40521caa9373e6a12188d0f48fa62891f6a59b1874a4a82418
|
Provenance
The following attestation bundles were made for fortscript-0.2.3.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.3.tar.gz -
Subject digest:
407fca0b8ed01786bf6d2a68921b34c4280164430609679d56651e2381e52d95 - Sigstore transparency entry: 774120620
- Sigstore integration time:
-
Permalink:
WesleyQDev/fortscript@bae0f241fc7e566d44bb6bbd53e8f857f19d6f26 -
Branch / Tag:
refs/tags/0.2.3 - Owner: https://github.com/WesleyQDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bae0f241fc7e566d44bb6bbd53e8f857f19d6f26 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fortscript-0.2.3-py3-none-any.whl.
File metadata
- Download URL: fortscript-0.2.3-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 |
a2a0b6f900a8ffcda44d93fdb7a09734e4c8f0d3aa169fa7a19567223d86ba08
|
|
| MD5 |
8631d10a92411efeefc8f72dbe010952
|
|
| BLAKE2b-256 |
4555c23bb1379cbf3d5c8b27e1e037dc08e9541f8aa6a40e140e89b6a2641d04
|
Provenance
The following attestation bundles were made for fortscript-0.2.3-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.3-py3-none-any.whl -
Subject digest:
a2a0b6f900a8ffcda44d93fdb7a09734e4c8f0d3aa169fa7a19567223d86ba08 - Sigstore transparency entry: 774120621
- Sigstore integration time:
-
Permalink:
WesleyQDev/fortscript@bae0f241fc7e566d44bb6bbd53e8f857f19d6f26 -
Branch / Tag:
refs/tags/0.2.3 - Owner: https://github.com/WesleyQDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bae0f241fc7e566d44bb6bbd53e8f857f19d6f26 -
Trigger Event:
push
-
Statement type: