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

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

fortscript-0.2.1.tar.gz (6.1 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.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

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

Hashes for fortscript-0.2.1.tar.gz
Algorithm Hash digest
SHA256 67d8fb9c079c116f80b52bd070e43a7a0b8f25cc175d3c08e19432dc8fd85be5
MD5 53a054c44999f31dafb90ca10aedabe2
BLAKE2b-256 a13c59ff6dbe5ec9ad3452945939f718ccfa576d72419f83e83f9d271372eda4

See more details on using hashes here.

Provenance

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

Hashes for fortscript-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b407c619af7bff543caf8ad058336d9f1bab367882b9027943b0a2f75b177e8
MD5 880dbe2d83184f21fa4d86f9f7db8be3
BLAKE2b-256 cfe4c002c227bfb446a7ef63fbfaabdf93991b5271e2ed532cd8993a53ccc54a

See more details on using hashes here.

Provenance

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