Skip to main content

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.

English | Português

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.yaml file 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)
  • 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

fortscript-0.2.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fortscript-0.2.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file fortscript-0.2.2.tar.gz.

File metadata

  • Download URL: fortscript-0.2.2.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

Hashes for fortscript-0.2.2.tar.gz
Algorithm Hash digest
SHA256 313bba6a54e19a40a0309e8092559d7fa822de6e0fd66d3c2820c73d233eb4c5
MD5 44ff8287a9bb108e0d2e709459997fa6
BLAKE2b-256 4e57b7f2118b50e2d91ca038ab040344b7364831b17e4809c3ce3db38a53b525

See more details on using hashes here.

Provenance

The following attestation bundles were made for fortscript-0.2.2.tar.gz:

Publisher: release.yml on WesleyQDev/fortscript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fortscript-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: fortscript-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fortscript-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 06883cc7cd3a0a9d0c6b726d39fd211875d2fe6a32b21bdef12b0c6c2395fb42
MD5 2c88336b08a576ffe4f3b2c82ef2d816
BLAKE2b-256 cb1f945b1b079ad5cac8e2a7c7700185689e0482ffe513b6cbdf0df465abce2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fortscript-0.2.2-py3-none-any.whl:

Publisher: release.yml on WesleyQDev/fortscript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page