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.4.tar.gz (30.5 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.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fortscript-0.2.4.tar.gz
  • Upload date:
  • Size: 30.5 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.4.tar.gz
Algorithm Hash digest
SHA256 f3b516130141d743bfd9f5cdb7aa1805a67b481ecd1f7711a423ae2fd0679584
MD5 286fd659d1094f3baea16bb4d789a040
BLAKE2b-256 43e20b32a43036fe49ecb122508304b84c301b357111c34446bd39729029e1ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for fortscript-0.2.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: fortscript-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 7.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0cc97ca8d28c5e6e4bc990e169cbbebe3bc7f5a811e77ee487915ea41d4f2250
MD5 b37879827b4ce863a33c90933d7f7d01
BLAKE2b-256 f555babc5d9b7fedb7287797d9c3359618cc09c03da659c6f4a0c0af593069e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fortscript-0.2.4-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