Pause your scripts automatically when gaming or running heavy apps.
Project description
What is FortScript?
Have you ever left a bot, an API, or a script running in the background while gaming, only to notice the game started lagging? Or forgot about processes silently consuming memory until your PC slowed down?
FortScript solves this automatically. It pauses your scripts when you open a game or resource-heavy application, and resumes them when you close it. Simple as that.
How it works
- You define which scripts you want to manage (Python bots, Node.js projects, etc.)
- You define which applications are "heavy" (games, video editors, etc.)
- FortScript monitors and does the rest: pauses when needed, resumes when possible.
Installation
FortScript can be used in two ways: as a Python library or via command line (CLI). Both come in the same package.
Installation as a project dependency
Use this option if you want to integrate FortScript into an existing Python project:
# UV (recommended)
uv add fortscript
# Poetry
poetry add fortscript
# pip
pip install fortscript
Global installation (CLI)
Use this option if you want to use the fort command directly in the terminal, without writing code:
pipx install fortscript
Prerequisites
- Python 3.10+
- Node.js (only if managing JavaScript/TypeScript projects)
Configuration
Regardless of how you use FortScript (code or CLI), configuration is done through a config.yaml file:
# Scripts that FortScript will manage
projects:
- name: "My Discord Bot"
path: "./bot/main.py"
- name: "Node API"
path: "./api/package.json"
# Applications that will pause the scripts above
heavy_processes:
- name: "GTA V"
process: "gta5"
- name: "OBS Studio"
process: "obs64"
# Pause scripts if RAM exceeds this limit (%)
ram_threshold: 85
Explanation:
projects: List of scripts/projects that FortScript will start and manage.heavy_processes: When any of these applications open, scripts are paused.ram_threshold: If system RAM exceeds this value, scripts are also paused.
Supported project types
| Type | Extension | Behavior |
|---|---|---|
| Python | .py |
Automatically detects .venv in the script's folder |
| Node.js | package.json |
Runs npm run start |
How to Use
Option 1: Via Python code
Ideal for integrating FortScript into an existing project or having programmatic control:
from fortscript import FortScript
app = FortScript(config_path="config.yaml")
app.run()
Option 2: Via CLI (terminal)
Ideal for quick use without writing code:
# Navigate to the folder with your config.yaml
cd my_project
# Run
fort
Note: The CLI currently runs FortScript from the
config.yaml. Additional commands likefort addare planned for future versions.
Practical Example
Imagine you have the following project structure:
my_project/
├── discord_bot/
│ ├── .venv/
│ └── main.py
├── express_api/
│ ├── node_modules/
│ └── package.json
├── config.yaml
└── manager.py
The manager.py would be:
from fortscript import FortScript
app = FortScript(config_path="config.yaml")
app.run()
When you open GTA V, FortScript automatically:
- Pauses the Discord bot
- Pauses the Express API
- Displays the pause reason in the terminal
When you close GTA V, everything resumes automatically.
Roadmap
Library
-
.exesupport: Manage executables directly. - Configuration via arguments: Pass
projects,heavy_processes, andram_thresholddirectly in code, without needing a YAML file. - Custom functions: Manage Python functions beyond external files.
- Games module: Pre-defined list of popular games.
Games module preview:
from fortscript import FortScript
from fortscript.games import GAMES
# GAMES contains dozens of popular games
app = FortScript(heavy_processes=GAMES)
app.run()
| Included games | |
|---|---|
| Minecraft, GTA V, Fortnite | Counter-Strike 2, Valorant, League of Legends |
| Roblox, Apex Legends | ...and many more |
CLI
- System Tray: Run minimized in the system tray.
- Additional commands:
fort add <path>- Add project to configfort list- List configured projectsfort remove <name>- Remove project
Current Features
- Automatic pause when detecting heavy applications
- Automatic pause by RAM limit
- Python script support with
.venvdetection - Node.js project support via
npm run start - Safe process termination (tree-kill)
Contributing
Contributions are welcome! See the Contributing Guide to get started.
License
MIT - See LICENSE for details.
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.5.tar.gz.
File metadata
- Download URL: fortscript-0.2.5.tar.gz
- Upload date:
- Size: 72.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 |
dae3415d42989b5ce9015bb4d75b2182ebfc20ddca79eb70a5df0ec7da452b38
|
|
| MD5 |
6a997ccf6aac92e0ca21be8981b3c1e1
|
|
| BLAKE2b-256 |
ea2081030a13f79407bff86d348928a083091c1f1546a3aa4efabdedda17425e
|
Provenance
The following attestation bundles were made for fortscript-0.2.5.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.5.tar.gz -
Subject digest:
dae3415d42989b5ce9015bb4d75b2182ebfc20ddca79eb70a5df0ec7da452b38 - Sigstore transparency entry: 775838755
- Sigstore integration time:
-
Permalink:
WesleyQDev/fortscript@c4656b3b7a02a170aff681dbad031fe31ac341ec -
Branch / Tag:
refs/tags/0.2.5 - Owner: https://github.com/WesleyQDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4656b3b7a02a170aff681dbad031fe31ac341ec -
Trigger Event:
push
-
Statement type:
File details
Details for the file fortscript-0.2.5-py3-none-any.whl.
File metadata
- Download URL: fortscript-0.2.5-py3-none-any.whl
- Upload date:
- Size: 8.3 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 |
36d758fc7af6f14c92668d657e73bf41c63563d97ae0f97ca0a52baf319c187b
|
|
| MD5 |
758365ac64ea9c398c368b18305b2b3c
|
|
| BLAKE2b-256 |
a20c61e6112d2b9c8d1ab0c17d28483848aaf1152d954f4bf1ba089b6c9eaedc
|
Provenance
The following attestation bundles were made for fortscript-0.2.5-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.5-py3-none-any.whl -
Subject digest:
36d758fc7af6f14c92668d657e73bf41c63563d97ae0f97ca0a52baf319c187b - Sigstore transparency entry: 775838758
- Sigstore integration time:
-
Permalink:
WesleyQDev/fortscript@c4656b3b7a02a170aff681dbad031fe31ac341ec -
Branch / Tag:
refs/tags/0.2.5 - Owner: https://github.com/WesleyQDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4656b3b7a02a170aff681dbad031fe31ac341ec -
Trigger Event:
push
-
Statement type: